-
Notifications
You must be signed in to change notification settings - Fork 72
57 lines (45 loc) · 1.48 KB
/
coverage.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
name: 📊 Code Coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
coverage:
runs-on: ubuntu-latest
env:
CODE_TYPE: stable
CODE_VERSION: max
TEST_RESOURCES: test-resources
steps:
- name: 👷🏻 Checkout Repository
uses: actions/checkout@v4
- name: ⚙️ Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: 🔧 Install
run: npm ci
- name: 🔧 Build
run: npm run build
- name: 🔧 Install - Test Project
run: npm install --workspace=extester-test
- name: ⚙️ Allow unprivileged user namespace (ubuntu)
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: 📊 Run Tests with Coverage enabled
# 'set +e' and 'exit 0' - that means the workflow will not fail even the test failures are present. The failing tests are not directive for the code coverage reports itself
run: |
set +e
xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm run test:coverage
exit 0
- name: 💾 Upload Coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage
path: ${{ github.workspace }}/tests/**/coverage