@@ -5,9 +5,12 @@ name: Flutter CI
5
5
# Controls when the action will run.
6
6
on :
7
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 : [ "master" ]
11
+ # Runs this when a PR against master is created
10
12
pull_request :
13
+ branches : [ "master" ]
11
14
12
15
# Allows you to run this workflow manually from the Actions tab
13
16
workflow_dispatch :
@@ -22,28 +25,35 @@ jobs:
22
25
# Steps represent a sequence of tasks that will be executed as part of the job
23
26
steps :
24
27
# 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'
28
+ - name : Clone repository
29
+ uses : actions/checkout@v4
30
+
31
31
# Setup the flutter environment.
32
- - uses : subosito/flutter-action@v2
32
+ - name : Setup Flutter
33
+ uses : subosito/flutter-action@v2
33
34
with :
34
- flutter-version : " 3.3.2"
35
35
channel : ' stable'
36
36
cache : true
37
+
38
+ - name : Verify Flutter version
39
+ run : flutter --version
40
+
37
41
# Get flutter dependencies.
38
- - run : flutter pub get
42
+ - name : Getting dependencies
43
+ run : flutter pub get
44
+
39
45
# 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
46
+ - name : Verify formatting
47
+ run : dart format --output=none --set-exit-if-changed lib/ test/ example/
48
+
49
+ - name : Analyze project source
50
+ run : dart analyze --fatal-infos --fatal-warnings lib/ test/ example/
51
+
52
+ - name : Run tests
53
+ run : flutter test --no-pub --coverage
54
+
45
55
- name : Upload coverage to Codecov
46
- uses : codecov/codecov-action@v1
56
+ uses : codecov/codecov-action@v4
47
57
with :
48
58
token : ${{ secrets.CODECOV_TOKEN }}
49
59
file : ./coverage/lcov.info
0 commit comments