3636 - '**/test/**'
3737 - '**/web/**'
3838 - '**/analysis_options.yaml'
39- - '**/melos.yaml'
4039 - '**/pubspec.yaml'
4140
4241 analyze :
@@ -50,18 +49,17 @@ jobs:
5049
5150 - uses : subosito/flutter-action@v2
5251 with :
53- channel : ' stable'
52+ channel : " stable"
5453 cache : true
5554
56- - name : Install Melos
57- uses : bluefireteam/melos-action@v3
55+ - name : Get dependencies
56+ run : flutter pub get
5857
59- - name : Analyze packages
60- run : melos analyze
58+ - name : Check format
59+ run : dart format --set-exit-if-changed .
6160
62- - name : Check for the existence of unformatted files
63- # Cannot use `melos format` as it requires excluding files generated from the target file
64- run : melos run format:ci --no-select
61+ - name : Analyze
62+ run : flutter analyze
6563
6664 test :
6765 needs : check
@@ -74,17 +72,24 @@ jobs:
7472
7573 - uses : subosito/flutter-action@v2
7674 with :
77- channel : ' stable'
75+ channel : " stable"
7876 cache : true
7977
80- - name : Install Melos
81- uses : bluefireteam/melos-action@v3
78+ - name : Get dependencies
79+ run : flutter pub get
8280
83- - name : Run package tests
84- run : melos run test:ci --no-select
85-
86- - name : Upload coverage to Codecov
87- uses : codecov/codecov-action@v5
88- with :
89- token : ${{ secrets.CODECOV_TOKEN }}
90- files : coverage/lcov.info
81+ - name : Run tests
82+ run : |
83+ if test -d "test"; then
84+ if grep -q flutter "pubspec.yaml"; then
85+ flutter test --coverage
86+ else
87+ dart pub global activate coverage
88+ dart pub global run coverage:test_with_coverage
89+ fi
90+ fi
91+ - name : Upload coverage to codecov
92+ run : |
93+ if test -d "test"; then
94+ curl -s https://codecov.io/bash | bash
95+ fi
0 commit comments