@@ -4,10 +4,15 @@ name: Flutter CI
4
4
5
5
# Controls when the action will run.
6
6
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
8
9
push :
9
- branches : [master]
10
+ branches :
11
+ - master
12
+ # Runs this when a PR against master is created
10
13
pull_request :
14
+ branches :
15
+ - master
11
16
12
17
# Allows you to run this workflow manually from the Actions tab
13
18
workflow_dispatch :
@@ -22,28 +27,36 @@ jobs:
22
27
# Steps represent a sequence of tasks that will be executed as part of the job
23
28
steps :
24
29
# 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
+
31
33
# Setup the flutter environment.
32
- - uses : subosito/flutter-action@v2
34
+ - name : Setup Flutter
35
+ uses : subosito/flutter-action@v2
33
36
with :
34
- flutter-version : " 3.3.2"
35
37
channel : ' stable'
36
38
cache : true
39
+
40
+ - name : Verify Flutter version
41
+ run : flutter --version
42
+
37
43
# Get flutter dependencies.
38
- - run : flutter pub get
44
+ - name : Getting dependencies
45
+ run : flutter pub get
46
+
39
47
# 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
+
45
57
- name : Upload coverage to Codecov
46
- uses : codecov/codecov-action@v1
58
+ uses : codecov/codecov-action@v4
47
59
with :
60
+ fail_ci_if_error : true
48
61
token : ${{ secrets.CODECOV_TOKEN }}
49
62
file : ./coverage/lcov.info
0 commit comments