@@ -5,9 +5,12 @@ name: Flutter CI
55# Controls when the action will run.
66on :
77 # 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 : [ "master" ]
11+ # Runs this when a PR against master is created
1012 pull_request :
13+ branches : [ "master" ]
1114
1215 # Allows you to run this workflow manually from the Actions tab
1316 workflow_dispatch :
@@ -22,28 +25,35 @@ jobs:
2225 # Steps represent a sequence of tasks that will be executed as part of the job
2326 steps :
2427 # 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+
3131 # Setup the flutter environment.
32- - uses : subosito/flutter-action@v2
32+ - name : Setup Flutter
33+ uses : subosito/flutter-action@v2
3334 with :
34- flutter-version : " 3.3.2"
3535 channel : ' stable'
3636 cache : true
37+
38+ - name : Verify Flutter version
39+ run : flutter --version
40+
3741 # Get flutter dependencies.
38- - run : flutter pub get
42+ - name : Getting dependencies
43+ run : flutter pub get
44+
3945 # 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+
4555 - name : Upload coverage to Codecov
46- uses : codecov/codecov-action@v1
56+ uses : codecov/codecov-action@v4
4757 with :
4858 token : ${{ secrets.CODECOV_TOKEN }}
4959 file : ./coverage/lcov.info
0 commit comments