Skip to content

Commit 5c95727

Browse files
committed
Try generating code coverage
1 parent 51e16c0 commit 5c95727

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/dart.yml

+25
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,28 @@ jobs:
6060
- name: Run VM tests
6161
run: dart test --platform vm
6262
if: always() && steps.install.outcome == 'success'
63+
64+
coverage:
65+
needs: test
66+
runs-on: ${{ matrix.os }}
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
os: [ubuntu-latest]
71+
sdk: [2.12.0]
72+
steps:
73+
- uses: actions/checkout@v2
74+
- uses: dart-lang/[email protected]
75+
with:
76+
sdk: ${{ matrix.sdk }}
77+
- id: install
78+
name: Install dependencies
79+
run: dart pub get
80+
- name: Generate Coverate
81+
run: ./scripts/gen_coverage.sh
82+
if: always() && steps.install.outcome == 'success'
83+
- name: Archive code coverage results
84+
uses: actions/upload-artifact@v2
85+
with:
86+
name: code-coverage-report
87+
path: coverage_html

scripts/gen_coverage.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
# This is supposed to run on the CI
3+
4+
set -eux
5+
6+
dart pub global activate coverage
7+
dart test --coverage="coverage"
8+
format_coverage --lcov --in=coverage --out=coverage.lcov --packages=.packages --report-on=lib
9+
10+
sudo apt-get install -y lcov
11+
genhtml coverage.lcov -o coverage_html

0 commit comments

Comments
 (0)