-
Notifications
You must be signed in to change notification settings - Fork 75
551 lines (533 loc) · 20.3 KB
/
test-and-deploy.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
name: Test and Deploy
on:
pull_request:
push:
branches:
- main
# Remaining circleci jobs to port
# - build-aarch64:
# - test-aarch64:
# - test-aarch64-without-git:
# - deploy:
# - release:
jobs:
build-linux-and-macos-x64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18
cache: 'npm'
- name: Install deps
run: npm ci
- name: Test
run: make test
- name: Build
run: |
make build
make build_macos_x64
- name: Upload artifacts
uses: actions/[email protected]
with:
name: build-linux-and-macos-x64
if-no-files-found: error
path: |
coverage/
out/
package.json
vendor/
build-macos-arm64:
runs-on: macos-latest
needs: build-linux-and-macos-x64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18
cache: 'npm'
architecture: arm64
- name: Install deps
run: npm ci
- name: Test
run: make test
- name: Build
run: |
make build_macos_arm64
- name: Upload artifacts
uses: actions/[email protected]
with:
name: build-macos-arm64
if-no-files-found: error
path: |
coverage/
out/
package.json
vendor/
build-alpine:
runs-on: ubuntu-latest
container: alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
needs: build-linux-and-macos-x64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Download prebuilt static node binary
run: |
apk add wget coreutils make
NODE_RELEASE=node.v16.2.0_b57a0d7c9ecba551879997ac44bba3c9d9443df5
wget https://github.com/codecov/node-static-alpine/releases/download/$NODE_RELEASE/node
wget https://github.com/codecov/node-static-alpine/releases/download/$NODE_RELEASE/SHA1SUM
wget https://github.com/codecov/node-static-alpine/releases/download/$NODE_RELEASE/SHA256SUM
wget https://github.com/codecov/node-static-alpine/releases/download/$NODE_RELEASE/SHA512SUM
for i in 1 256 512; do "sha${i}sum" -c "SHA${i}SUM"; done
- name: Confirm that alpine node binary is static
run: |
apk add file
(file node | grep 'static') || exit ${?}
- name: Create pkg-cache directory and copy static NodeJS binary
run: |
mkdir -p ~/.pkg-cache/v2.6
cp node ~/.pkg-cache/v2.6/fetched-v14.0.0-alpine-x64
- name: Remove downloaded binary and run tests
run: |
rm -rf node
apk add npm git
npm ci
npm test
mkdir -p coverage-alpine
cp -r coverage/* coverage-alpine/
- name: Build uploader binary on alpine
run: make build_alpine
- name: Upload artifacts
uses: actions/[email protected]
with:
name: build-alpine
if-no-files-found: error
path: |
coverage-alpine
out/codecov-alpine
build-windows:
runs-on: windows-latest
needs: build-linux-and-macos-x64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18
cache: 'npm'
- name: Install deps
run: |
$ErrorActionPreference="Stop"
node --version
npm ci; npm test
- name: Build
run: |
$ErrorActionPreference="Stop"
npm run build; npm run build-windows
- name: Upload artifacts
uses: actions/[email protected]
with:
name: build-windows
if-no-files-found: error
path: |
coverage/
out/codecov.exe
test-linux:
runs-on: ubuntu-latest
needs: build-linux-and-macos-x64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18
- uses: actions/[email protected]
with:
name: build-linux-and-macos-x64
- name: Confirm that linux uploader binary is static
run: (file out/codecov-linux | grep 'static') || exit ${?}
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-linux
- name: Run Linux binary -f (dry run)
run: |
out/codecov-linux -f coverage/cobertura-coverage.xml -F linux -d -Z -v -t ${{ secrets.CODECOV_TOKEN }} | tee output_linux.txt
- name: Run Linux binary auto-detect (dry run)
run: |
out/codecov-linux -F linux -d -Z | tee -a output_linux.txt
- name: Run Linux binary (upload)
run: |
out/codecov-linux -F linux -Z -t ${{ secrets.CODECOV_TOKEN }}
out/codecov-linux -F "-linux" -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-linux
if-no-files-found: error
path: |
output_linux.txt
test-linux-without-git:
runs-on: ubuntu-latest
needs: build-linux-and-macos-x64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18
- uses: actions/[email protected]
with:
name: build-linux-and-macos-x64
- name: Remove .git directory
run: rm -rf .git
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-linux
- name: Run Linux binary (dry run)
run: |
out/codecov-linux -F linux-without-git -d -Z | tee -a output_linux_without_git.txt
- name: Run Linux binary (upload)
run: |
out/codecov-linux -F linux-without-git -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-linux-without-git
if-no-files-found: error
path: |
output_linux_without_git.txt
test-macos-x64:
runs-on: macos-latest-large
needs: build-linux-and-macos-x64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-linux-and-macos-x64
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-macos-x64
- name: Run MacOS binary -f (dry-run)
run: |
out/codecov-macos-x64 -f coverage/cobertura-coverage.xml -F macos-x64 -d -Z -v -t ${{ secrets.CODECOV_TOKEN }} | tee output_macos_x64.txt
- name: Run MacOS binary auto-detect (dry-run)
run: |
out/codecov-macos-x64 -F macos-x64 -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_macos_x64.txt
- name: Run MacOS binary (upload)
run: |
out/codecov-macos-x64 -F macos-x64 -v -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-macos-x64
if-no-files-found: error
path: |
output_macos_x64.txt
test-macos-x64-without-git:
runs-on: macos-latest-large
needs: build-linux-and-macos-x64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-linux-and-macos-x64
- name: Remove .git directory
run: rm -rf .git
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-macos-x64
- name: Run MacOS binary (dry-run)
run: |
out/codecov-macos-x64 -F macos-x64-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_macos_x64_without_git.txt
- name: Run MacOS binary (upload)
run: |
out/codecov-macos-x64 -F macos-x64-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-macos-x64-without-git
if-no-files-found: error
path: |
output_macos_x64_without_git.txt
test-macos-arm64:
runs-on: macos-latest
needs: build-macos-arm64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-macos-arm64
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-macos-arm64
- name: Run MacOS binary -f (dry-run)
run: |
out/codecov-macos-arm64 -f coverage/cobertura-coverage.xml -F macos-arm64 -d -Z -v -t ${{ secrets.CODECOV_TOKEN }} | tee output_macos_arm64.txt
- name: Run MacOS binary auto-detect (dry-run)
run: |
out/codecov-macos-arm64 -F macos-arm64 -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_macos_arm64.txt
- name: Run MacOS binary (upload)
run: |
out/codecov-macos-arm64 -F macos-arm64 -v -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-macos-arm64
if-no-files-found: error
path: |
output_macos_arm64.txt
test-macos-arm64-without-git:
runs-on: macos-latest
needs: build-macos-arm64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-macos-arm64
- name: Remove .git directory
run: rm -rf .git
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-macos-arm64
- name: Run MacOS binary (dry-run)
run: |
out/codecov-macos-arm64 -F macos-arm64-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_macos_arm64_without_git.txt
- name: Run MacOS binary (upload)
run: |
out/codecov-macos-arm64 -F macos-arm64-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-macos-arm64-without-git
if-no-files-found: error
path: |
output_macos_arm64_without_git.txt
test-alpine:
runs-on: ubuntu-latest
container: alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
needs: build-alpine
steps:
- name: Install git
run: |
apk update
apk add git
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-alpine
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-alpine
- name: Run Alpine binary -f (dry run)
run: |
NODE_DEBUG=vm out/codecov-alpine -v -f ./coverage-alpine/cobertura-coverage.xml -F alpine -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine.txt
- name: Run Alpine binary auto-detect (dry run)
run: |
out/codecov-alpine -F alpine -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine.txt
- name: Run Alpine binary (upload)
run: out/codecov-alpine -F alpine -v -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-alpine
if-no-files-found: error
path: |
output_alpine.txt
test-alpine-without-git:
runs-on: ubuntu-latest
container: alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
needs: build-alpine
steps:
- name: Install git
run: |
apk update
apk add git
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-alpine
- name: Remove .git directory
run: rm -rf .git
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-alpine
- name: Run Alpine binary -f (dry run)
run: |
NODE_DEBUG=vm out/codecov-alpine -v -f ./coverage-alpine/cobertura-coverage.xml -F alpine-without-git -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine_without_git.txt
- name: Run Alpine binary auto-detect (dry run)
run: |
out/codecov-alpine -F alpine-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine_without_git.txt
- name: Run Alpine binary (upload)
run: out/codecov-alpine -F alpine-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-alpine-without-git
if-no-files-found: error
path: |
output_alpine_without_git.txt
test-alpine-proxy:
runs-on: ubuntu-latest
container: alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
needs: build-alpine
steps:
- name: Install git
run: |
apk update
apk add git squid
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-alpine
- name: Start squid
run: squid
- name: Remove test coverage files
run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo
- name: Update exec permission
run: chmod u+x out/codecov-alpine
- name: Run Alpine binary auto-detect (dry run)
run: |
out/codecov-alpine -U http://localhost:3128 -F alpine-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine_proxy.txt
- name: Run Alpine binary (upload)
run: out/codecov-alpine -U http://localhost:3128 -F alpine-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-alpine-proxy
if-no-files-found: error
path: |
output_alpine_proxy.txt
test-windows:
runs-on: windows-latest
needs: build-windows
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-windows
- name: Remove test coverage files
run: |
Remove-Item -Recurse -Force *.coverage.txt; echo "ok"
Remove-Item -Recurse -Force test/fixtures; echo "ok"
- name: Run Windows binary -f (dry-run)
run: |
dir .
attrib .\coverage\cobertura-coveage.xml
.\out\codecov.exe -f .\coverage\cobertura-coverage.xml -F windows -d -Z -v -t ${{ secrets.CODECOV_TOKEN }} | tee output_win.txt
shell: cmd
- name: Run Windows binary auto-detect (dry-run)
run: |
.\out\codecov.exe -F windows -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_win.txt
shell: cmd
- name: Run Windows binary (upload)
run: |
.\out\codecov.exe -F windows -v -Z -t ${{ secrets.CODECOV_TOKEN }}
shell: cmd
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-windows
if-no-files-found: error
path: |
output_win.txt
test-windows-without-git:
runs-on: windows-latest
needs: build-windows
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/[email protected]
with:
name: build-windows
- name: Remove .git directory
run: del -Recurse -Force .git
- name: Remove test coverage files
run: |
Remove-Item -Recurse -Force *.coverage.txt; echo "ok"
Remove-Item -Recurse -Force test/fixtures; echo "ok"
- name: Run Windows binary -f (dry-run)
run: |
dir .
attrib .\coverage\cobertura-coveage.xml
.\out\codecov.exe -f .\coverage\cobertura-coverage.xml -F windows-without-git -d -Z -v -t ${{ secrets.CODECOV_TOKEN }} | tee output_win_without_git.txt
shell: cmd
- name: Run Windows binary auto-detect (dry-run)
run: |
.\out\codecov.exe -F windows-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_win_without_git.txt
shell: cmd
- name: Run Windows binary (upload)
run: |
.\out\codecov.exe -F windows-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }}
shell: cmd
- name: Upload artifacts
uses: actions/[email protected]
with:
name: test-windows-without-git
if-no-files-found: error
path: |
output_win_without_git.txt
review:
runs-on: ubuntu-latest
needs:
- test-alpine
- test-alpine-proxy
- test-alpine-without-git
- test-linux
- test-linux-without-git
- test-macos-x64
- test-macos-x64-without-git
- test-macos-arm64
- test-macos-arm64-without-git
- test-windows
- test-windows-without-git
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18
cache: 'npm'
- uses: actions/[email protected]
- name: List files
run: tree
- name: Cat output_alpine.txt
run: cat test-alpine/output_alpine.txt
- name: Cat output_alpine_proxy.txt
run: cat test-alpine-proxy/output_alpine_proxy.txt
- name: Cat output_alpine_without_git.txt
run: cat test-alpine-without-git/output_alpine_without_git.txt
- name: Cat test-linux/output_linux.txt
run: cat test-linux/output_linux.txt
- name: Cat test-linux-without-git/output_linux_without_git.txt
run: cat test-linux-without-git/output_linux_without_git.txt
- name: Cat test-macos-arm64/output_macos_arm64.txt
run: cat test-macos-arm64/output_macos_arm64.txt
- name: Cat test-macos-arm64-without-git/output_macos_arm64_without_git.txt
run: cat test-macos-arm64-without-git/output_macos_arm64_without_git.txt
- name: Cat test-macos-x64/output_macos_x64.txt
run: cat test-macos-x64/output_macos_x64.txt
- name: Cat test-macos-x64-without-git/_macos_x64_without_git.txt
run: cat test-macos-x64-without-git/_macos_x64_without_git.txt
- name: Cat test-windows/output_win.txt
run: cat test-windows/output_win.txt
- name: Cat test-windows-without-git/output_win_without_git.txt
run: cat test-windows-without-git/output_win_without_git.txt