-
Notifications
You must be signed in to change notification settings - Fork 4
104 lines (85 loc) · 2.72 KB
/
tests.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Tests
on:
push:
branches: [development]
pull_request:
jobs:
changes:
name: Check for changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
packages: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
aform: aform/**
atable: atable/**
beam: beam/**
test:
name: ${{ matrix.package }} (test)
needs: changes
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
include:
- branch: development
artifact: development
- branch: ${{ github.head_ref }}
artifact: pull-request
permissions:
# Required to checkout the code
contents: read
steps:
- name: Checkout (${{ matrix.branch }})
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache-dependency-path: '**/config/rush/pnpm-lock.yaml'
registry-url: https://registry.npmjs.org/
- name: Rush Install
run: node common/scripts/install-run-rush.js install
- name: Rush Build
run: node common/scripts/install-run-rush.js rebuild --verbose
- name: Run Tests
working-directory: ./${{ matrix.package }}
run: node ../common/scripts/install-run-rushx.js test:coverage
- name: Upload Coverage
if: always() # upload the coverage report even if tests are failing
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.package }}-${{ matrix.artifact }}
path: ./${{ matrix.package }}/coverage
coverage:
name: ${{ matrix.package }} (coverage)
needs: [changes, test]
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
steps:
- name: Download PR Branch Coverage
uses: actions/download-artifact@v4
with:
name: coverage-${{ matrix.package }}-pull-request
path: coverage
- name: Download Base Branch Coverage
uses: actions/download-artifact@v4
with:
name: coverage-${{ matrix.package }}-development
path: coverage-${{ matrix.package }}-development
- name: Report Coverage
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ./${{ matrix.package }}
file-coverage-mode: 'all'
vite-config-path: './vite.config.ts'
json-summary-compare-path: coverage-${{ matrix.package }}-development/coverage-summary.json