-
Notifications
You must be signed in to change notification settings - Fork 205
35 lines (31 loc) · 1.18 KB
/
unittests.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
name: Unit Tests
on:
push:
schedule:
- cron: '0 8 * * *'
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.9.x'
- run: npm ci
- run: npm run build-glean
# Run the regular tests on push
- run: npm test
if: github.event_name != 'schedule'
# But measure coverage without ignore markers in the nighly job
- name: Remove `c8 ignore` markers to output full unit test coverage if on the `report-coverage` branch
run: find src/ -type f -name "*.js" -or -name "*.ts" -or -name "*.jsx" -or -name "*.tsx" -exec sed --in-place --expression='s/c8 ignore/c8 TEMPORARILY DO NOT ignore/g' {} \;
if: github.event_name == 'schedule'
# (and set an arbitrary coverage threshold for that "true" coverage):
- run: npm test -- --coverageThreshold='{"global":{"branches":80,"functions":80,"lines":80,"statements":80}}'
if: github.event_name == 'schedule'
- uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 30