@@ -4,10 +4,15 @@ name: Flutter CI
44
55# Controls when the action will run.
66on :
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
0 commit comments