-
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (57 loc) · 1.8 KB
/
code-coverage.yml
File metadata and controls
69 lines (57 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Code Coverage
on: [push, pull_request]
env:
PUB_ENVIRONMENT: bot.github
jobs:
test_with_coverage:
name: Unit Tests with Coverage
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Cache Pub Dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install Melos
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Bootstrap Workspace
run: melos bootstrap
- name: Run Tests with Coverage
run: flutter test --coverage
working-directory: packages/local_storage_cache
- name: Verify Coverage File
run: |
if [ -f "packages/local_storage_cache/coverage/lcov.info" ]; then
echo "Coverage file found"
ls -lh packages/local_storage_cache/coverage/lcov.info
else
echo "Coverage file not found"
exit 1
fi
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: packages/local_storage_cache/coverage/lcov.info
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: packages/local_storage_cache/coverage/lcov.info
flags: unittests
name: codecov-flutter
fail_ci_if_error: true