Skip to content

Commit dfc3fc5

Browse files
authored
ci: update ci-related script files
Closes #163
1 parent a90f09e commit dfc3fc5

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

.github/workflows/build.yml

+30-17
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ name: Flutter CI
44

55
# Controls when the action will run.
66
on:
7-
# Triggers the workflow on push request events but only for the master branch
7+
# Triggers the workflow on push or pull request events but only for the main branch
8+
# Runs this action when you push on master
89
push:
9-
branches: [master]
10+
branches:
11+
- master
12+
# Runs this when a PR against master is created
1013
pull_request:
14+
branches:
15+
- master
1116

1217
# Allows you to run this workflow manually from the Actions tab
1318
workflow_dispatch:
@@ -22,28 +27,36 @@ jobs:
2227
# Steps represent a sequence of tasks that will be executed as part of the job
2328
steps:
2429
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
25-
- uses: actions/checkout@v2
26-
# Java environment.
27-
- uses: actions/setup-java@v3
28-
with:
29-
distribution: 'zulu'
30-
java-version: '12.x'
30+
- name: Clone repository
31+
uses: actions/checkout@v4
32+
3133
# Setup the flutter environment.
32-
- uses: subosito/flutter-action@v2
34+
- name: Setup Flutter
35+
uses: subosito/flutter-action@v2
3336
with:
34-
flutter-version: "3.3.2"
3537
channel: 'stable'
3638
cache: true
39+
40+
- name: Verify Flutter version
41+
run: flutter --version
42+
3743
# Get flutter dependencies.
38-
- run: flutter pub get
44+
- name: Getting dependencies
45+
run: flutter pub get
46+
3947
# Check for any formatting issues in the code.
40-
- run: flutter format --set-exit-if-changed lib/ test/ example/
41-
# Statically analyze the Dart code for any errors.
42-
- run: flutter analyze --no-current-package lib/ test/ example/
43-
# Run widget tests for our flutter project.
44-
- run: flutter test --no-pub --coverage
48+
- name: Verify formatting
49+
run: dart format --output=none --set-exit-if-changed lib/ test/ example/
50+
51+
- name: Analyze project source
52+
run: dart analyze --fatal-infos --fatal-warnings lib/ test/ example/
53+
54+
- name: Run tests
55+
run: flutter test --no-pub --coverage
56+
4557
- name: Upload coverage to Codecov
46-
uses: codecov/codecov-action@v1
58+
uses: codecov/codecov-action@v4
4759
with:
60+
fail_ci_if_error: true
4861
token: ${{ secrets.CODECOV_TOKEN }}
4962
file: ./coverage/lcov.info

.rultor.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
docker:
2-
image: cirrusci/flutter:stable
2+
image: ghcr.io/cirruslabs/flutter:stable
33
as_root: true
44
architect:
55
- rafamizes
@@ -10,10 +10,7 @@ merge:
1010
script: |
1111
flutter clean
1212
flutter pub get
13-
flutter format --set-exit-if-changed lib/ test/ example/
14-
flutter analyze --no-current-package lib/ test/ example/
15-
flutter test --no-pub --coverage
16-
bash <(curl -s https://codecov.io/bash)
13+
flutter test --no-pub
1714
flutter pub publish --dry-run
1815
release:
1916
# updates pubspec.yaml's version attribute to $tag;
@@ -23,9 +20,11 @@ release:
2320
# repository.
2421
script: |-
2522
sed -i "s/^\(version:\).*/\1 $tag/" pubspec.yaml
26-
sed -i "/\[Unreleased\]/a\\\n## [$tag] - $(date '+%F')" CHANGELOG.md
23+
sed -i "/\[[Uu]nreleased\]/a\\\n## [$tag] - $(date '+%F')" CHANGELOG.md
2724
mkdir -p ~/.pub-cache
2825
mv ../credentials.json ~/.pub-cache/credentials.json
26+
flutter clean
27+
flutter pub get
2928
flutter pub publish -f
3029
git commit -am "version $tag"
3130
git checkout master

0 commit comments

Comments
 (0)