-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (56 loc) · 1.65 KB
/
test.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Tests
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
name: 🐛 Run tests
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
shell: bash
strategy:
matrix:
node_version: [18, 19, 20, 21]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: node common/scripts/install-run-rush.js install
- name: Build projects
run: node common/scripts/install-run-rush.js rebuild
- name: Run tests
if: ${{ matrix.node_version != '18' }}
run: node common/scripts/install-run-rush.js test
- name: Run tests and generate coverage reports
if: ${{ matrix.node_version == '18' }}
run: node common/scripts/install-run-rush.js test --coverage
- name: Archive code coverage reports
if: ${{ matrix.node_version == '18' }}
uses: actions/upload-artifact@v4
with:
name: code-coverage-reports
path: modules/**/clover.xml
retention-days: 1
coverage:
needs: test
name: ⬆️ Upload code coverage reports to Codecov
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
shell: bash
steps:
- name: Download reports from previous job
uses: actions/download-artifact@v4
with:
name: code-coverage-reports
- name: Upload reports to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true