@@ -12,23 +12,56 @@ jobs:
1212 - name : Checkout
1313 uses : actions/checkout@v3
1414
15- # Note: This workflow uses the latest stable version of the Dart SDK.
16- # You can specify other versions if desired, see documentation here:
17- # https://github.com/dart-lang/setup-dart/blob/main/README.md
18- - uses : dart-lang/setup-dart@v1.4
19- # - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
20-
21- - name : Analyze project source
22- run : dart analyze --fatal-infos
15+ - name : Setup Java JDK
16+ uses : actions/setup-java@v3
17+ with :
18+ distribution : temurin
19+ java-version : " 17"
2320
24- - name : Run tests
25- run : dart test --coverage="coverage"
21+ - name : Flutter action
22+ uses : subosito/flutter-action@v2.8.0
23+ with :
24+ channel : stable
25+
26+ - name : Flutter version
27+ run : flutter --version
28+
29+ - name : Cache pubspec dependencies
30+ uses : actions/cache@v3.0.7
31+ with :
32+ path : |
33+ ${{ env.FLUTTER_HOME }}/.pub-cache
34+ **/.packages
35+ **/.flutter-plugins
36+ **/.flutter-plugin-dependencies
37+ **/.dart_tool/package_config.json
38+ key : build-pubspec-${{ hashFiles('**/pubspec.lock') }}
39+ restore-keys : |
40+ build-pubspec-
2641
27- - name : Install dependencies
28- run : dart pub get
42+ - name : Cache build runner
43+ uses : actions/cache@v2
44+ with :
45+ path : |
46+ **/.dart_tool
47+ **/*.g.dart
48+ **/*.mocks.dart
49+ **/*.config.dart
50+ key : build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
51+ restore-keys : |
52+ build-runner-
53+
54+ - name : Download pub dependencies
55+ run : flutter pub get
56+
57+ - name : Run analyzer
58+ run : flutter analyze --fatal-infos
2959
3060 - name : Install coverage tools
31- run : dart pub global activate coverage
61+ run : flutter pub global activate coverage
62+
63+ - name : Run tests
64+ run : flutter test --coverage-path="coverage"
3265
3366 - name : Format Coverage
3467 run : $HOME/.pub-cache/bin/format_coverage --lcov --in=coverage --out=coverage/coverage.lcov --report-on=lib
@@ -44,14 +77,13 @@ jobs:
4477 sh ./pub_login.sh
4578
4679 - name : Check Publish Warnings
47- run : dart pub publish --dry-run
80+ run : flutter pub publish --dry-run
4881
4982 - name : Publish Package
50- run : dart pub publish -f
51-
83+ run : flutter pub publish -f
84+
5285 - name : Upload Coverage to CodeCov
5386 uses : codecov/codecov-action@v3
5487 with :
5588 token : ${{secrets.CODECOV_TOKEN}}
56- file : ./network_tools/coverage/coverage.lcov
57-
89+ file : ./coverage/coverage.lcov
0 commit comments