Skip to content

Commit 090e0d9

Browse files
authored
Merge pull request #255 from osociety/codecov-fix
Fix codecov issue 5
2 parents 029ecc5 + 9672f54 commit 090e0d9

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

.github/workflows/dart.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,39 @@ jobs:
4545
- name: Analyze project source
4646
run: dart analyze --fatal-infos
4747

48-
- name: Run tests
48+
- name: Run tests (Linux)
49+
if: runner.os == 'Linux'
50+
run: dart test --coverage="./coverage"
51+
52+
- name: Run tests (non-Linux)
53+
if: runner.os != 'Linux'
4954
run: dart test
5055

56+
- name: Install coverage tools (Linux)
57+
if: runner.os == 'Linux'
58+
run: dart pub global activate coverage
59+
60+
- name: Install lcov (Linux)
61+
if: runner.os == 'Linux'
62+
run: sudo apt-get update && sudo apt-get install -y lcov
63+
64+
- name: Format coverage and generate lcov (Linux)
65+
if: runner.os == 'Linux'
66+
run: dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib
67+
68+
- name: Remove generated files from lcov (Linux)
69+
if: runner.os == 'Linux'
70+
run: lcov --remove ./coverage/lcov.info '*/lib/src/*.g.dart' '*/lib/src/models/drift/*' -o ./coverage/lcov.info
71+
72+
- name: Upload coverage to Codecov (Linux)
73+
if: runner.os == 'Linux'
74+
uses: codecov/codecov-action@v3
75+
with:
76+
token: ${{ secrets.CODECOV_TOKEN }}
77+
files: ./coverage/lcov.info
78+
flags: unittests
79+
name: codecov-umbrella
80+
verbose: true
81+
5182
- name: Check Publish Warnings
5283
run: dart pub publish --dry-run

0 commit comments

Comments
 (0)