-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (61 loc) · 1.82 KB
/
coverage-workflow.yml
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
70
71
72
73
name: Coverage Workflow
on:
workflow_call: # Makes the workflow reusable
inputs:
branch_name:
required: true
type: string
event_name:
required: true
type: string
jobs:
test-and-upload:
runs-on: ubuntu-latest
outputs:
coverage-path: ${{ steps.upload_artifact.outputs.artifact-path }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install dependencies
run: dart pub get
- name: Run tests with coverage
run: dart test --coverage=coverage
- name: Generate LCOV report
run: |
dart pub global activate coverage
dart run coverage:format_coverage \
--report-on=lib \
--lcov \
-i coverage \
--out=coverage/lcov.info
- name: List coverage files
run: ls -al coverage
- name: Upload coverage artifact
id: upload_artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/lcov.info
upload-coverage:
runs-on: ubuntu-latest
needs: test-and-upload
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download coverage artifact
uses: actions/download-artifact@v4
with:
name: coverage-report
path: ./coverage
- name: List coverage files after download
run: ls -al coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: open-feature/dart-server-sdk
files: ./coverage/lcov.info