1
- # Useful GitHub Actions docs:
1
+ # This is a GitHub workflow defining a set of jobs with a set of steps.
2
+ # ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2
3
#
3
- # - https://help.github.com/en/actions
4
- # - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
5
- # - https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
6
- # - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
7
-
8
4
name : Test
9
5
10
6
on :
26
22
workflow_dispatch :
27
23
28
24
jobs :
29
- # Job to run linter / autoformat
30
- lint :
25
+ # Audit dependencies for known vulnerabilities
26
+ audit-dependencies :
31
27
runs-on : ubuntu-20.04
32
28
steps :
33
- # Action Repo: https://github.com/actions/checkout
34
- - name : " Checkout repo"
35
- uses : actions/checkout@v2
36
-
37
- # Action Repo: https://github.com/actions/setup-node
38
- - name : " Setup Node"
39
- uses : actions/setup-node@v1
29
+ - uses : actions/checkout@v2
30
+ - uses : actions/setup-node@v1
40
31
with :
41
- node-version : " 14 "
32
+ node-version : " 16 "
42
33
43
34
# Action Repo: https://github.com/actions/cache
44
35
- name : " Cache node_modules"
@@ -49,23 +40,17 @@ jobs:
49
40
restore-keys : |
50
41
${{ runner.os }}-npm-
51
42
52
- - name : " Install"
43
+ - name : " Install dependencies (npm ci) "
53
44
run : |
54
45
npm ci
55
46
56
- # Run the pre-commit action
57
- # Repo: https://github.com/pre-commit/action
58
- - uses : actions/setup-python@v2
59
- -
uses :
pre-commit/[email protected]
60
-
61
47
- name : npm audit
62
48
run : |
63
49
# If this fails, run `npm audit fix`
64
50
npm audit --production --audit-level=moderate
65
51
66
52
test :
67
53
runs-on : ubuntu-20.04
68
- # - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy
69
54
strategy :
70
55
fail-fast : false # Do not cancel all jobs if one fails
71
56
matrix :
81
66
- " 17"
82
67
83
68
steps :
84
- - name : " Checkout repo"
85
- uses : actions/checkout@v2
86
-
87
- # Action Repo: https://github.com/actions/setup-node
88
- - name : " Setup Node"
89
- uses : actions/setup-node@v1
69
+ - uses : actions/checkout@v2
70
+ - uses : actions/setup-node@v1
90
71
with :
91
72
node-version : ${{ matrix.node_version }}
92
73
99
80
restore-keys : |
100
81
${{ runner.os }}-npm-
101
82
102
- - name : " Install dependencies"
83
+ - name : " Install dependencies (npm ci) "
103
84
run : |
104
85
npm ci
105
86
0 commit comments