42
42
offlinedocs : ${{ steps.filter.outputs.offlinedocs }}
43
43
tailnet-integration : ${{ steps.filter.outputs.tailnet-integration }}
44
44
steps :
45
+ - name : Harden Runner
46
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
47
+ with :
48
+ egress-policy : audit
49
+
45
50
- name : Checkout
46
51
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
47
52
with :
@@ -157,6 +162,11 @@ jobs:
157
162
if : needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
158
163
runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
159
164
steps :
165
+ - name : Harden Runner
166
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
167
+ with :
168
+ egress-policy : audit
169
+
160
170
- name : Checkout
161
171
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
162
172
with :
@@ -213,12 +223,23 @@ jobs:
213
223
./actionlint -color -shellcheck= -ignore "set-output"
214
224
shell : bash
215
225
226
+ - name : Check for unstaged files
227
+ run : |
228
+ rm -f ./actionlint ./typos
229
+ ./scripts/check_unstaged.sh
230
+ shell : bash
231
+
216
232
gen :
217
233
timeout-minutes : 8
218
234
runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
219
235
needs : changes
220
236
if : needs.changes.outputs.docs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
221
237
steps :
238
+ - name : Harden Runner
239
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
240
+ with :
241
+ egress-policy : audit
242
+
222
243
- name : Checkout
223
244
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
224
245
with :
@@ -268,6 +289,11 @@ jobs:
268
289
runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
269
290
timeout-minutes : 7
270
291
steps :
292
+ - name : Harden Runner
293
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
294
+ with :
295
+ egress-policy : audit
296
+
271
297
- name : Checkout
272
298
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
273
299
with :
@@ -304,6 +330,11 @@ jobs:
304
330
- macos-latest
305
331
- windows-2022
306
332
steps :
333
+ - name : Harden Runner
334
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
335
+ with :
336
+ egress-policy : audit
337
+
307
338
- name : Checkout
308
339
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
309
340
with :
@@ -358,6 +389,11 @@ jobs:
358
389
# even if some of the preceding steps are slow.
359
390
timeout-minutes : 25
360
391
steps :
392
+ - name : Harden Runner
393
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
394
+ with :
395
+ egress-policy : audit
396
+
361
397
- name : Checkout
362
398
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
363
399
with :
@@ -398,6 +434,11 @@ jobs:
398
434
# even if some of the preceding steps are slow.
399
435
timeout-minutes : 25
400
436
steps :
437
+ - name : Harden Runner
438
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
439
+ with :
440
+ egress-policy : audit
441
+
401
442
- name : Checkout
402
443
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
403
444
with :
@@ -425,11 +466,16 @@ jobs:
425
466
api-key : ${{ secrets.DATADOG_API_KEY }}
426
467
427
468
test-go-race :
428
- runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }}
469
+ runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16 ' || 'ubuntu-latest' }}
429
470
needs : changes
430
471
if : needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
431
472
timeout-minutes : 25
432
473
steps :
474
+ - name : Harden Runner
475
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
476
+ with :
477
+ egress-policy : audit
478
+
433
479
- name : Checkout
434
480
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
435
481
with :
@@ -441,9 +487,13 @@ jobs:
441
487
- name : Setup Terraform
442
488
uses : ./.github/actions/setup-tf
443
489
490
+ # We run race tests with reduced parallelism because they use more CPU and we were finding
491
+ # instances where tests appear to hang for multiple seconds, resulting in flaky tests when
492
+ # short timeouts are used.
493
+ # c.f. discussion on https://github.com/coder/coder/pull/15106
444
494
- name : Run Tests
445
495
run : |
446
- gotestsum --junitfile="gotests.xml" -- -race ./...
496
+ gotestsum --junitfile="gotests.xml" -- -race -parallel 4 -p 4 ./...
447
497
448
498
- name : Upload test stats to Datadog
449
499
timeout-minutes : 1
@@ -466,6 +516,11 @@ jobs:
466
516
if : needs.changes.outputs.tailnet-integration == 'true' || needs.changes.outputs.ci == 'true'
467
517
timeout-minutes : 20
468
518
steps :
519
+ - name : Harden Runner
520
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
521
+ with :
522
+ egress-policy : audit
523
+
469
524
- name : Checkout
470
525
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
471
526
with :
@@ -487,6 +542,11 @@ jobs:
487
542
if : needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
488
543
timeout-minutes : 20
489
544
steps :
545
+ - name : Harden Runner
546
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
547
+ with :
548
+ egress-policy : audit
549
+
490
550
- name : Checkout
491
551
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
492
552
with :
@@ -499,21 +559,26 @@ jobs:
499
559
working-directory : site
500
560
501
561
test-e2e :
502
- runs-on : ${{ github.repository_owner == 'coder' && (matrix.variant.enterprise && 'depot-ubuntu-22.04' || 'depot-ubuntu-22.04-4') || 'ubuntu-latest' }}
503
562
# test-e2e fails on 2-core 8GB runners, so we use the 4-core 16GB runner
563
+ runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || 'ubuntu-latest' }}
504
564
needs : changes
505
565
if : needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
506
566
timeout-minutes : 20
507
567
strategy :
508
568
fail-fast : false
509
569
matrix :
510
570
variant :
511
- - enterprise : false
571
+ - premium : false
512
572
name : test-e2e
513
- - enterprise : true
514
- name : test-e2e-enterprise
573
+ - premium : true
574
+ name : test-e2e-premium
515
575
name : ${{ matrix.variant.name }}
516
576
steps :
577
+ - name : Harden Runner
578
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
579
+ with :
580
+ egress-policy : audit
581
+
517
582
- name : Checkout
518
583
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
519
584
with :
@@ -535,38 +600,35 @@ jobs:
535
600
- run : pnpm playwright:install
536
601
working-directory : site
537
602
538
- # Run tests that don't require an enterprise license without an enterprise license
603
+ # Run tests that don't require a premium license without a premium license
539
604
- run : pnpm playwright:test --forbid-only --workers 1
540
- if : ${{ !matrix.variant.enterprise }}
605
+ if : ${{ !matrix.variant.premium }}
541
606
env :
542
607
DEBUG : pw:api
543
608
working-directory : site
544
609
545
- # Run all of the tests with an enterprise license
610
+ # Run all of the tests with a premium license
546
611
- run : pnpm playwright:test --forbid-only --workers 1
547
- if : ${{ matrix.variant.enterprise }}
612
+ if : ${{ matrix.variant.premium }}
548
613
env :
549
614
DEBUG : pw:api
550
- CODER_E2E_ENTERPRISE_LICENSE : ${{ secrets.CODER_E2E_ENTERPRISE_LICENSE }}
551
- CODER_E2E_REQUIRE_ENTERPRISE_TESTS : " 1"
615
+ CODER_E2E_LICENSE : ${{ secrets.CODER_E2E_LICENSE }}
616
+ CODER_E2E_REQUIRE_PREMIUM_TESTS : " 1"
552
617
working-directory : site
553
- # Temporarily allow these to fail so that I can gather data about which
554
- # tests are failing.
555
- continue-on-error : true
556
618
557
619
- name : Upload Playwright Failed Tests
558
620
if : always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork
559
621
uses : actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
560
622
with :
561
- name : failed-test-videos${{ matrix.variant.enterprise && '-enterprise ' || '-agpl ' }}
623
+ name : failed-test-videos${{ matrix.variant.premium && '-premium ' || '' }}
562
624
path : ./site/test-results/**/*.webm
563
625
retention-days : 7
564
626
565
627
- name : Upload pprof dumps
566
628
if : always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork
567
629
uses : actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
568
630
with :
569
- name : debug-pprof-dumps${{ matrix.variant.enterprise && '-enterprise ' || '-agpl ' }}
631
+ name : debug-pprof-dumps${{ matrix.variant.premium && '-premium ' || '' }}
570
632
path : ./site/test-results/**/debug-pprof-*.txt
571
633
retention-days : 7
572
634
@@ -576,6 +638,11 @@ jobs:
576
638
needs : changes
577
639
if : needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true'
578
640
steps :
641
+ - name : Harden Runner
642
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
643
+ with :
644
+ egress-policy : audit
645
+
579
646
- name : Checkout
580
647
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
581
648
with :
@@ -648,6 +715,11 @@ jobs:
648
715
if : needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.docs == 'true'
649
716
650
717
steps :
718
+ - name : Harden Runner
719
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
720
+ with :
721
+ egress-policy : audit
722
+
651
723
- name : Checkout
652
724
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
653
725
with :
@@ -716,6 +788,11 @@ jobs:
716
788
# cancelled.
717
789
if : always()
718
790
steps :
791
+ - name : Harden Runner
792
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
793
+ with :
794
+ egress-policy : audit
795
+
719
796
- name : Ensure required checks
720
797
run : |
721
798
echo "Checking required checks"
@@ -749,6 +826,11 @@ jobs:
749
826
outputs :
750
827
IMAGE : ghcr.io/coder/coder-preview:${{ steps.build-docker.outputs.tag }}
751
828
steps :
829
+ - name : Harden Runner
830
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
831
+ with :
832
+ egress-policy : audit
833
+
752
834
- name : Checkout
753
835
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
754
836
with :
@@ -868,6 +950,11 @@ jobs:
868
950
contents : read
869
951
id-token : write
870
952
steps :
953
+ - name : Harden Runner
954
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
955
+ with :
956
+ egress-policy : audit
957
+
871
958
- name : Checkout
872
959
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
873
960
with :
@@ -925,6 +1012,11 @@ jobs:
925
1012
needs : build
926
1013
if : github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
927
1014
steps :
1015
+ - name : Harden Runner
1016
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
1017
+ with :
1018
+ egress-policy : audit
1019
+
928
1020
- name : Checkout
929
1021
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
930
1022
with :
@@ -955,6 +1047,11 @@ jobs:
955
1047
needs : changes
956
1048
if : needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
957
1049
steps :
1050
+ - name : Harden Runner
1051
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
1052
+ with :
1053
+ egress-policy : audit
1054
+
958
1055
- name : Checkout
959
1056
uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
960
1057
with :
0 commit comments