4
4
secrets :
5
5
codecov_token :
6
6
required : true
7
+ permissions : {}
7
8
jobs :
8
9
lint :
9
10
name : Lint source files
10
11
runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : read # for actions/checkout
11
14
steps :
12
15
- name : Checkout repo
13
- uses : actions/checkout@v2
16
+ uses : actions/checkout@v4
14
17
with :
15
18
persist-credentials : false
16
19
@@ -35,31 +38,44 @@ jobs:
35
38
- name : Spellcheck
36
39
run : npm run check:spelling
37
40
41
+ - name : Lint GitHub Actions
42
+ uses : docker://rhysd/actionlint:latest
43
+ with :
44
+ args : -color
45
+
38
46
checkForCommonlyIgnoredFiles :
39
47
name : Check for commonly ignored files
40
48
runs-on : ubuntu-latest
49
+ permissions :
50
+ contents : read # for actions/checkout
41
51
steps :
42
52
- name : Checkout repo
43
- uses : actions/checkout@v2
53
+ uses : actions/checkout@v4
44
54
with :
45
55
persist-credentials : false
46
56
47
57
- name : Check if commit contains files that should be ignored
48
58
run : |
49
- git clone --depth 1 https://github.com/github/gitignore.git &&
50
- cat gitignore/Node.gitignore $(find gitignore/Global -name "*.gitignore" | grep -v ModelSim) > all.gitignore &&
51
- if [[ "$(git ls-files -iX all.gitignore)" != "" ]]; then
52
- echo "::error::Please remove these files:"
53
- git ls-files -iX all.gitignore
59
+ git clone --depth 1 https://github.com/github/gitignore.git
60
+
61
+ rm gitignore/Global/ModelSim.gitignore
62
+ rm gitignore/Global/Images.gitignore
63
+ cat gitignore/Node.gitignore gitignore/Global/*.gitignore > all.gitignore
64
+
65
+ IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
66
+ if [[ "$IGNORED_FILES" != "" ]]; then
67
+ echo -e "::error::Please remove these files:\n$IGNORED_FILES" | sed -z 's/\n/%0A/g'
54
68
exit 1
55
69
fi
56
70
57
71
checkPackageLock :
58
72
name : Check health of package-lock.json file
59
73
runs-on : ubuntu-latest
74
+ permissions :
75
+ contents : read # for actions/checkout
60
76
steps :
61
77
- name : Checkout repo
62
- uses : actions/checkout@v2
78
+ uses : actions/checkout@v4
63
79
with :
64
80
persist-credentials : false
65
81
72
88
- name : Install Dependencies
73
89
run : npm ci --ignore-scripts
74
90
91
+ - name : Check that package-lock.json doesn't have conflicts
92
+ run : npm ls --depth 999
93
+
75
94
- name : Run npm install
76
95
run : npm install --ignore-scripts --force --package-lock-only --engine-strict --strict-peer-deps
77
96
@@ -81,9 +100,11 @@ jobs:
81
100
integrationTests :
82
101
name : Run integration tests
83
102
runs-on : ubuntu-latest
103
+ permissions :
104
+ contents : read # for actions/checkout
84
105
steps :
85
106
- name : Checkout repo
86
- uses : actions/checkout@v2
107
+ uses : actions/checkout@v4
87
108
with :
88
109
persist-credentials : false
89
110
@@ -103,9 +124,11 @@ jobs:
103
124
fuzz :
104
125
name : Run fuzzing tests
105
126
runs-on : ubuntu-latest
127
+ permissions :
128
+ contents : read # for actions/checkout
106
129
steps :
107
130
- name : Checkout repo
108
- uses : actions/checkout@v2
131
+ uses : actions/checkout@v4
109
132
with :
110
133
persist-credentials : false
111
134
@@ -156,9 +179,11 @@ jobs:
156
179
strategy :
157
180
matrix :
158
181
node_version_to_setup : [12, 14, 16, 17]
182
+ permissions :
183
+ contents : read # for actions/checkout
159
184
steps :
160
185
- name : Checkout repo
161
- uses : actions/checkout@v2
186
+ uses : actions/checkout@v4
162
187
with :
163
188
persist-credentials : false
164
189
@@ -174,13 +199,35 @@ jobs:
174
199
- name : Run Tests
175
200
run : npm run testonly
176
201
202
+ codeql :
203
+ name : Run CodeQL security scan
204
+ runs-on : ubuntu-latest
205
+ permissions :
206
+ contents : read # for actions/checkout
207
+ security-events : write # for codeql-action
208
+ steps :
209
+ - name : Checkout repo
210
+ uses : actions/checkout@v4
211
+ with :
212
+ persist-credentials : false
213
+
214
+ - name : Initialize CodeQL
215
+ uses : github/codeql-action/init@v3
216
+ with :
217
+ languages : ' javascript, typescript'
218
+
219
+ - name : Perform CodeQL analysis
220
+ uses : github/codeql-action/analyze@v3
221
+
177
222
build-npm-dist :
178
223
name : Build 'npmDist' artifact
179
224
runs-on : ubuntu-latest
180
225
needs : [test, fuzz, lint, integrationTests]
226
+ permissions :
227
+ contents : read # for actions/checkout
181
228
steps :
182
229
- name : Checkout repo
183
- uses : actions/checkout@v2
230
+ uses : actions/checkout@v4
184
231
with :
185
232
persist-credentials : false
186
233
@@ -206,15 +253,18 @@ jobs:
206
253
name : Build 'denoDist' artifact
207
254
runs-on : ubuntu-latest
208
255
needs : [test, fuzz, lint, integrationTests]
256
+ permissions :
257
+ contents : read # for actions/checkout
209
258
steps :
210
259
- name : Checkout repo
211
- uses : actions/checkout@v2
260
+ uses : actions/checkout@v4
212
261
with :
213
262
persist-credentials : false
214
263
215
264
- name : Setup Node.js
216
265
uses : actions/setup-node@v4
217
266
with :
267
+ cache : npm
218
268
node-version-file : ' .node-version'
219
269
220
270
- name : Install Dependencies
0 commit comments