-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 1.67 KB
/
test.yml
File metadata and controls
63 lines (61 loc) · 1.67 KB
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
name: test
on:
workflow_call:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: node 18
uses: actions/setup-node@v4
with:
node-version: 18
- run: npm cache clean --force
- run: npm ci
- run: npm test
# @todo #0:1h use --test-coverage-exclude to exclude tests from cov
# when https://github.com/nodejs/node/pull/53553 is landed and node 18 EOL
# @todo #0:1h use --test-coverage-branches
# when https://github.com/nodejs/node/pull/54429 is landed and node 18 EOL
- run: |
COV_PERCENT_MIN=90
COV_PERCENT=$(npm test | grep 'all files' | cut -d'|' -f3) # all files branch cov
echo "branch coverage $COV_PERCENT should be greater then $COV_PERCENT_MIN"
node -e "process.exit($COV_PERCENT > $COV_PERCENT_MIN ? 0 : 1)"
semgrep:
runs-on: ubuntu-latest
container: returntocorp/semgrep:latest
permissions:
packages: read
steps:
- uses: actions/checkout@v5
- name: semgrep ci
run: semgrep ci
--config p/default
--metrics=off
--no-git-ignore
--no-suppress-errors
npm-audit:
runs-on: ubuntu-latest
container: node:18
steps:
- uses: actions/checkout@v5
- run: npm audit
fuzz:
runs-on: ubuntu-latest
container: node:18
steps:
- uses: actions/checkout@v5
- run: npm ci
- run: npm run fuzz
- name: upload fuzz/in fuzz/crashes
uses: actions/upload-artifact@v4
with:
name: fuzz
path: fuzz
retention-days: 30