-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (41 loc) · 1.44 KB
/
coverage.yaml
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
# Generate code coverage reports and uploads them to Codecov
name: 🐛 Code coverage
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
jobs:
generate:
name: Generate coverage reports
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
shell: bash
outputs:
reports_path: ${{ steps.list_reports_path.outputs.reports_path }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Install
run: node common/scripts/install-run-rush.js install
- name: 🏗 Build
run: node common/scripts/install-run-rush.js rebuild
- name: 🐛 Test
run: node common/scripts/install-run-rush.js test --coverage
- name: List module names for which a coverage report has been generated
id: list_reports_path
# directories_names is an array of strings formatted like that: ./modules/common/coverage.
# syntax checked with https://www.shellcheck.net/
# https://yaml-multiline.info/
run: |
reports_path=$(find ./modules -name clover.xml | tr '\n' ',')
echo "reports_path=$reports_path" >> "$GITHUB_OUTPUT"
- name: ⤒ Upload coverage reports
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ${{ steps.list_reports_path.outputs.reports_path }}