Repository navigation
1818 lines (1739 loc) · 82.5 KB
/
Copy pathci.yaml
File metadata and controls
1818 lines (1739 loc) · 82.5 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
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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI
on:
push:
branches:
- main
- ci-bisect
- ci-bisect-**
pull_request:
workflow_dispatch:
# Pull requests: a new push cancels the run in progress for the same branch.
# Pushes to main share one group but never cancel a run in progress: GitHub
# keeps at most one running and one pending run per group, and a newer pending
# run replaces the older one. A burst of merges therefore runs the commit in
# progress and then the newest, rather than every commit in between. Every run
# that starts still finishes, so the index-cache artifact and the realm-server
# test weights always come from complete main runs. ci-bisect pushes, whose
# every commit must be tested, and hand-run builds keep a group of their own.
# The main group is `push:main` because `:` cannot appear in a branch name, so
# no pull request's head_ref (a fork's `main`, say) can land in it and cancel a
# main run.
concurrency:
group: ci-${{ github.head_ref || (github.event_name == 'push' && github.ref == 'refs/heads/main' && 'push:main') || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
checks: write
contents: read
id-token: write
# Lets the warm-test-images step pull the private GHCR mirror packages.
packages: read
pull-requests: write
jobs:
change-check:
name: Check which packages changed
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
boxel: ${{ steps.filter.outputs.boxel }}
ai-bot: ${{ steps.filter.outputs.ai-bot }}
bot-runner: ${{ steps.filter.outputs.bot-runner }}
eslint-plugin-boxel: ${{ steps.filter.outputs.eslint-plugin-boxel }}
eslint-plugin-cardstack-host: ${{ steps.filter.outputs.eslint-plugin-cardstack-host }}
postgres-migrations: ${{ steps.filter.outputs.postgres-migrations }}
boxel-icons: ${{ steps.filter.outputs.boxel-icons }}
boxel-ui: ${{ steps.filter.outputs.boxel-ui }}
pretui: ${{ steps.filter.outputs.pretui }}
choreo: ${{ steps.filter.outputs.choreo }}
choreo-addon: ${{ steps.filter.outputs.choreo-addon }}
glimmer-motion: ${{ steps.filter.outputs.glimmer-motion }}
matrix: ${{ steps.filter.outputs.matrix }}
realm-server: ${{ steps.filter.outputs.realm-server }}
vscode-boxel-tools: ${{ steps.filter.outputs.vscode-boxel-tools }}
boxel-cli: ${{ steps.filter.outputs.boxel-cli }}
bxl: ${{ steps.filter.outputs.bxl }}
bench-amd: ${{ steps.filter.outputs.bench-amd }}
bench-realm: ${{ steps.filter.outputs.bench-realm }}
deployed-realms: ${{ steps.filter.outputs.deployed-realms }}
secure-origin: ${{ steps.filter.outputs.secure-origin }}
# Force all tests to run when on ci-bisect* branches
run_all: ${{ steps.force-run-all.outputs.run_all }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: |
shared: &shared
- '.github/workflows/ci.yaml'
- 'packages/runtime-common/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
# CI boot path. Each gated suite runs `./.github/actions/init`
# (which calls `jdx/mise-action`, sourcing `.mise.toml` for tool
# versions) and then `mise run test-services:*` (which sources
# every script under mise-tasks/, with dev-log-tee.sh as a
# runtime dep). A breaking change to any of these can take down
# all the suites without matching a per-package filter — the
# exact failure mode that hid PR #4671.
- '.mise.toml'
- '.github/actions/**'
- 'mise-tasks/**'
- 'packages/observability/scripts/**'
boxel:
- *shared
# The host compiles this package's source as a workspace dependency,
# so a change here is a host change.
- 'packages/pretui/**'
- '.github/workflows/build-host.yml'
- '.github/workflows/deploy-host.yml'
- '.github/workflows/deploy-release.yml'
- '.github/workflows/deploy-ui.yml'
- '.github/workflows/manual-deploy.yml'
- 'packages/ai-bot/**'
- 'packages/bot-runner/**'
- 'packages/base/**'
- 'packages/boxel-icons/**'
- 'packages/boxel-ui/**'
- 'packages/bxl/**'
- 'packages/host/**'
- 'packages/realm-server/**'
- 'packages/secure-origin/**'
- 'packages/test-realm-cards/**'
ai-bot:
- *shared
- '.github/workflows/pr-ai-bot.yml'
- 'packages/ai-bot/**'
- 'packages/billing/**'
- 'packages/postgres/**'
bot-runner:
- *shared
- 'packages/bot-runner/**'
- 'packages/postgres/**'
eslint-plugin-boxel:
- *shared
- 'packages/eslint-plugin-boxel/**'
eslint-plugin-cardstack-host:
- *shared
- 'packages/eslint-plugin-cardstack-host/**'
postgres-migrations:
- 'packages/postgres/migrations/**'
- 'packages/postgres/migrations-removal/**'
- 'packages/postgres/scripts/determine-changed-migrations.sh'
boxel-icons:
- *shared
- 'packages/boxel-icons/**'
boxel-ui:
- *shared
- 'packages/boxel-icons/**'
- 'packages/boxel-ui/**'
- 'packages/boxel-ui/docs-app/**'
pretui:
- *shared
- 'packages/pretui/**'
choreo:
- *shared
- 'packages/choreo/**'
- 'packages/choreo-film-app/**'
- 'packages/choreo-gallery/**'
- 'packages/choreo-player/**'
- 'packages/glimmer-motion/**'
# choreo builds on glimmer-motion's extension point, so a
# glimmer-motion change runs choreo's suite too.
choreo-addon:
- *shared
- 'packages/choreo/**'
- 'packages/glimmer-motion/**'
glimmer-motion:
- *shared
- 'packages/glimmer-motion/**'
secure-origin:
- *shared
- 'packages/secure-origin/**'
# Realm content the realm-server image carries and each deploy
# copies onto the realm's disk, so a change to it needs a staging
# deploy even when it touches no other boxel package. The gallery
# realm's film app is built from choreo-film-app, which compiles
# choreo and glimmer-motion from source.
deployed-realms:
- 'packages/choreo-gallery/realm/**'
- 'packages/choreo-film-app/**'
- 'packages/choreo/**'
- 'packages/glimmer-motion/**'
matrix:
- *shared
- 'packages/base/**'
- 'packages/boxel-icons/**'
- 'packages/boxel-ui/**'
- 'packages/host/**'
- 'packages/matrix/**'
- 'packages/realm-server/**'
- 'packages/secure-origin/**'
- 'packages/test-realm-cards/**'
realm-server:
- *shared
- 'packages/billing/**'
- 'packages/boxel-icons/**'
- 'packages/boxel-ui/**'
- 'packages/bxl/**'
- 'packages/host/**'
- 'packages/eslint-plugin-boxel/**'
- 'packages/postgres/**'
- 'packages/realm-server/**'
- 'packages/secure-origin/**'
- 'packages/test-realm-cards/**'
vscode-boxel-tools:
- *shared
- 'packages/vscode-boxel-tools/**'
boxel-cli:
- *shared
- 'packages/boxel-cli/**'
# The boxel-skills pin lives in the marketplaces, and the
# boxel-cli suite checks it (both refs agree, the pinned release
# is installable), so a pin-only change has to run that suite.
- '.claude-plugin/marketplace.json'
- '.agents/plugins/marketplace.json'
# boxel-cli bundles these packages' source for `boxel parse`.
- 'packages/glimmer-motion/**'
- 'packages/choreo/**'
bxl:
# The suite is self-contained — plain objects under Node, no
# stack and no browser — so it stays cheap even when the
# shared CI-boot paths trigger it.
- *shared
- 'packages/bxl/**'
# The card-authoring skill's claims are pinned by a BXL suite
# that reads the skill from the pinned boxel-skills release, so
# moving the pin has to run that suite too.
- '.claude-plugin/marketplace.json'
- 'packages/boxel-cli/scripts/boxel-skills.mts'
# That suite also asserts the host suites the skill cites still
# exist. `bxl-test` runs unconditionally on main, so without
# these a host-only rename would merge green and redden main on
# a commit whose own CI never ran the failing suite.
- 'packages/host/tests/integration/bxl-*'
- 'packages/host/tests/helpers/cards/bxl-*'
bench-amd:
# The AMD transpiler is a runtime-common module with no
# cross-workspace deps that affect its wall-time, so the
# bench only needs to fire for runtime-common edits and
# the committed bench fixtures.
- 'packages/runtime-common/**'
- 'bench-fixtures/runtime-common/amd-transpile/**'
bench-realm:
# HTTP GET + search regression bench. Self-contained — the
# bench's source-realm snapshot lives under
# packages/realm-server/scripts/bench-realm/fixtures/, so
# software-factory changes can't move the bench medians.
# The packages that *can* affect the medians are the ones
# the bench's wire path actually exercises:
# runtime-common (definition lookup, query engine, file
# serializer), realm-server itself, postgres (schema
# migrations + the pg adapter the bench writes through),
# host (FastBoot prerender), the base realm, and the
# harness that spins up the ephemeral stack.
- *shared
- 'packages/base/**'
- 'packages/host/**'
- 'packages/postgres/**'
- 'packages/realm-server/**'
- 'packages/realm-test-harness/**'
- name: Force run all jobs on ci-bisect branches
id: force-run-all
shell: bash
run: |
echo "run_all=${{ startsWith(github.ref, 'refs/heads/ci-bisect') || startsWith(github.ref, 'refs/heads/ci-bisect-') || startsWith(github.head_ref || '', 'ci-bisect') }}" >> "$GITHUB_OUTPUT"
test-web-assets:
name: Build test web assets
needs: change-check
# choreo: the gallery's tests run against this host, which bundles
# glimmer-motion and Choreo from the same commit
if: needs.change-check.outputs.boxel == 'true' || needs.change-check.outputs.boxel-ui == 'true' || needs.change-check.outputs.matrix == 'true' || needs.change-check.outputs.realm-server == 'true' || needs.change-check.outputs.vscode-boxel-tools == 'true' || needs.change-check.outputs.boxel-cli == 'true' || needs.change-check.outputs.choreo == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
uses: ./.github/workflows/test-web-assets.yaml
with:
caller: ci
concurrency:
group: ci-test-web-assets-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
ai-bot-test:
name: AI bot Tests
needs: change-check
if: needs.change-check.outputs.ai-bot == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
concurrency:
group: ai-bot-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: AI Bot test suite
run: pnpm test
working-directory: packages/ai-bot
bot-runner-test:
name: Bot Runner Tests
needs: change-check
if: needs.change-check.outputs.bot-runner == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: bot-runner-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Bot Runner test suite
run: pnpm test
working-directory: packages/bot-runner
bxl-test:
name: BXL Tests
needs: change-check
if: needs.change-check.outputs.bxl == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: bxl-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: BXL test suite
run: pnpm test
working-directory: packages/bxl
# The suites above read `src/`. This packs the npm artifact, installs it
# outside the monorepo the way a consumer does, and checks that every
# published subpath loads under plain Node and type-checks — the only
# pre-merge signal about the thing bxl-publish.yml ships. Unlike the
# suites, it reaches the npm registry, to install the package's own
# dependencies into the throwaway consumer project.
- name: BXL published package check
run: pnpm run verify:package
working-directory: packages/bxl
host-deploy-cache-control-test:
name: Host Deploy Cache-Control Tests
needs: change-check
if: needs.change-check.outputs.boxel == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: host-deploy-cache-control-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
# Which `Cache-Control` each deployed file carries is decided entirely by
# config/deploy.js, and the deploy itself is the first place a mistake
# shows up — by which point a wrong directive is already in browsers that
# will not ask again. Needs nothing running.
- name: Host deploy cache-control suite
run: pnpm test:deploy-cache-control
working-directory: packages/host
eslint-plugin-boxel-test:
name: ESLint Plugin Boxel Tests
needs: change-check
if: needs.change-check.outputs.eslint-plugin-boxel == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: eslint-plugin-boxel-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: ESLint Plugin Boxel test suite
run: pnpm test
working-directory: packages/eslint-plugin-boxel
- name: Check generated files are up to date
working-directory: packages/eslint-plugin-boxel
run: |
pnpm run update
git diff --exit-code || (echo "::error::Generated files are out of date. Run 'pnpm run update' in packages/eslint-plugin-boxel and commit the result." && exit 1)
eslint-plugin-cardstack-host-test:
name: ESLint Plugin Cardstack Host Tests
needs: change-check
if: needs.change-check.outputs.eslint-plugin-cardstack-host == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: eslint-plugin-cardstack-host-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: ESLint Plugin Cardstack Host test suite
run: pnpm test
working-directory: packages/eslint-plugin-cardstack-host
- name: Check generated files are up to date
working-directory: packages/eslint-plugin-cardstack-host
run: |
pnpm run update
git diff --exit-code || (echo "::error::Generated files are out of date. Run 'pnpm run update' in packages/eslint-plugin-cardstack-host and commit the result." && exit 1)
postgres-migration-test:
name: Postgres Migration Test
needs: change-check
if: needs.change-check.outputs.postgres-migrations == 'true' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
concurrency:
group: postgres-migration-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: ./.github/actions/init
# Warm the test images from the GHCR mirror so the steps
# below start from a local image instead of an unauthenticated Docker Hub
# pull (the cause of the recurring registry-1.docker.io timeouts).
# Best-effort: a miss falls back to a hardened-retry Docker Hub pull.
- name: Warm test Docker images from the GHCR mirror
continue-on-error: true
uses: ./.github/actions/warm-test-images
- name: Start Postgres
run: pnpm start:pg
working-directory: packages/postgres
- name: Determine changed migrations
id: migrations
env:
PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha || '' }}
GITHUB_EVENT_BEFORE: ${{ github.event.before || '' }}
shell: bash
run: packages/postgres/scripts/determine-changed-migrations.sh
# Fail fast if a newly added additive migration drops/renames a column or
# table in its up() — those belong in migrations-removal/ (post-deploy) so
# they don't break the previous code revision mid-rollout.
- name: Guard removal-phase migrations
if: steps.migrations.outputs.count && steps.migrations.outputs.count != '0'
env:
# Newline-separated file list; the guard reads it from this env var
# (no shell word-splitting, no multiline value inlined into the script).
CHANGED_MIGRATIONS: ${{ steps.migrations.outputs.files }}
run: node packages/postgres/scripts/check-removal-phase.cjs
- name: Apply migrations
if: steps.migrations.outputs.count && steps.migrations.outputs.count != '0'
working-directory: packages/postgres
env:
PGHOST: localhost
PGPORT: 5435
run: pnpm migrate up
- name: Run down migrations
if: steps.migrations.outputs.count && steps.migrations.outputs.count != '0'
working-directory: packages/postgres
env:
MIGRATION_DOWN_COUNT: ${{ steps.migrations.outputs.down_count }}
run: pnpm migrate down "$MIGRATION_DOWN_COUNT"
- name: Reapply migrations
if: steps.migrations.outputs.count && steps.migrations.outputs.count != '0'
working-directory: packages/postgres
run: pnpm migrate up
boxel-ui-test:
name: Boxel UI Tests
needs: [change-check]
if: needs.change-check.outputs.boxel-ui == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: boxel-ui-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Restore boxel-icons build cache
id: icons-cache
uses: ./.github/actions/restore-icons-cache
- name: Build boxel-icons and boxel-ui
run: mise run build:ui
env:
SKIP_ICONS_BUILD: ${{ steps.icons-cache.outputs.cache-hit }}
- name: Run test suite
run: pnpm test
working-directory: packages/boxel-ui
- name: Run docs app test suite
run: pnpm test
working-directory: packages/boxel-ui/docs-app
pretui-test:
name: Pret UI Tests (shard ${{ matrix.shard }} of ${{ strategy.job-total }})
needs: [change-check]
if: needs.change-check.outputs.pretui == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
concurrency:
group: pretui-test-${{ matrix.shard }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
# Linting lives in ci-lint.yaml, which runs on every change to this
# package. This job only runs the package's *.test.gts files, through
# the boxel-cli test engine: it mounts the directory as an in-memory
# realm and drives the host test harness bundled with that CLI release,
# so no workspace install or realm-server is needed. The pin decides
# which host harness the tests run against; bump it deliberately.
- name: Install Boxel CLI
run: npm install -g @cardstack/boxel-cli@0.5.0
# The browser revision must match the CLI's own @playwright/test pin,
# so install through the CLI's nested playwright binary.
- name: Install Chromium
run: |
"$(npm root -g)/@cardstack/boxel-cli/node_modules/.bin/playwright" install --with-deps chromium
# `boxel test` caps a whole QUnit run at 300 s, so each job keeps a
# deterministic slice of the test files, balanced by the per-file run
# times in scripts/test-timings.json (refresh them with
# `node scripts/test-shards.mjs --record`). The shard count follows the
# matrix length, so resizing the matrix resizes the split.
- name: Select this shard's test files
run: node scripts/test-shards.mjs ${{ matrix.shard }} ${{ strategy.job-total }}
working-directory: packages/pretui
- name: Run tests
run: boxel test .
working-directory: packages/pretui
choreo-test:
name: Choreo Tests
needs: [change-check]
if: needs.change-check.outputs.choreo == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: choreo-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
# The gallery resolves these packages through their built output
# (package.json#exports maps into dist/ and declarations/). glimmer-motion
# builds first: choreo's declarations build resolves it the same way.
- name: Build Glimmer Motion, Choreo and Choreo Player
id: build-libs
if: ${{ !cancelled() }}
run: |
(cd packages/glimmer-motion && pnpm run build)
(cd packages/choreo && pnpm run build)
(cd packages/choreo-player && pnpm run build)
# npm consumers resolve every subpath to the built output. For
# glimmer-motion and choreo that means without the `developing:choreo`
# condition the workspace builds from source with. Each check packs its
# package and resolves every module's subpath against the tarball, so a
# `files` / `exports` mismatch fails here instead of on install.
- name: Check the packed glimmer-motion, Choreo and Choreo Player exports
if: ${{ !cancelled() && steps.build-libs.outcome == 'success' }}
run: |
(cd packages/glimmer-motion && pnpm run check:packed-exports)
(cd packages/choreo && pnpm run check:packed-exports)
(cd packages/choreo-player && pnpm run check:packed-exports)
- name: Choreo Player unit tests
if: ${{ !cancelled() && steps.build-libs.outcome == 'success' }}
run: pnpm run test:unit
working-directory: packages/choreo-player
# The release decisions choreo-player-publish.yml runs on, as pure
# functions under Node.
- name: Choreo Player release script tests
if: ${{ !cancelled() }}
run: pnpm run test:release
working-directory: packages/choreo-player
# The gallery realm's *.test.gts files. The realm's lint and its content
# check run in ci-lint.yaml.
choreo-gallery-test:
name: Choreo Gallery Tests
needs: [change-check, test-web-assets]
if: needs.change-check.outputs.choreo == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: choreo-gallery-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
# The boxel-cli test engine mounts realm/ as an in-memory realm and
# drives a host test harness, so no workspace install or realm-server
# is needed. The harness is this commit's host, from test-web-assets,
# not the one bundled with the CLI release: the gallery uses
# glimmer-motion and Choreo as they are in this commit, which a
# published CLI's host predates. The pin decides only the test engine.
- name: Download test web assets
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.test-web-assets.outputs.artifact_name }}
path: .test-web-assets-artifact
- name: Restore test web assets into workspace
shell: bash
run: |
shopt -s dotglob
cp -a .test-web-assets-artifact/. ./
- name: Install Boxel CLI
run: npm install -g @cardstack/boxel-cli@0.9.0-unstable.1
# The browser revision must match the CLI's own @playwright/test pin,
# so install through the CLI's nested playwright binary.
- name: Install Chromium
run: |
"$(npm root -g)/@cardstack/boxel-cli/node_modules/.bin/playwright" install --with-deps chromium
- name: Run tests
run: boxel test realm
working-directory: packages/choreo-gallery
env:
# the host package directory; the CLI reads its dist/
TEST_HARNESS_HOST_DIST_PACKAGE_DIR: ${{ github.workspace }}/packages/host
# glimmer-motion's own QUnit suite, which compiles the package from source.
glimmer-motion-test:
name: Glimmer Motion Tests
needs: [change-check]
if: needs.change-check.outputs.glimmer-motion == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: glimmer-motion-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
# The lockstep release decisions glimmer-motion-choreo-publish.yml runs
# on, as pure functions under Node.
- name: Release script tests
run: pnpm test:release
working-directory: packages/glimmer-motion
- name: Run test suite
run: pnpm test
working-directory: packages/glimmer-motion
# choreo's own QUnit suite (Choreo and film), which compiles choreo and
# glimmer-motion from source through the `developing:choreo` export
# condition.
choreo-addon-test:
name: Choreo Addon Tests
needs: [change-check]
if: needs.change-check.outputs.choreo-addon == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: choreo-addon-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Run test suite
run: pnpm test
working-directory: packages/choreo
# The secure origin's pages: the credential frame's protocol and the
# components each page draws, run in Chrome against a development build of
# the package with its tests entry.
secure-origin-test:
name: Secure Origin Tests
needs: [change-check]
if: needs.change-check.outputs.secure-origin == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: secure-origin-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Run test suite
run: pnpm test:components
working-directory: packages/secure-origin
# The film app's QUnit suite: the reference films' scores against their
# golden fixtures. It compiles glimmer-motion and Choreo from source through
# the `developing:choreo` export condition. Then the realm build `pnpm push`
# makes, so a change that breaks it fails here rather than at deploy.
choreo-film-app-test:
name: Choreo Film App Tests
needs: [change-check]
if: needs.change-check.outputs.choreo == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
concurrency:
group: choreo-film-app-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Run test suite
run: pnpm test
working-directory: packages/choreo-film-app
- name: Build the film app into the gallery realm
if: ${{ !cancelled() }}
run: pnpm build:realm
working-directory: packages/choreo-film-app
# glimmer-motion's and choreo's suites against the packages' built output,
# the code npm consumers get. Only the rollup build
# inlines and tree-shakes framer-motion's internals, so these are the runs
# that exercise it. CHOREO_LIBS=dist leaves the `developing:choreo`
# condition out of each suite's Vite config.
choreo-dist-test:
name: Glimmer Motion and Choreo Tests (built output)
needs: [change-check]
if: needs.change-check.outputs.choreo == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: choreo-dist-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
# glimmer-motion builds first: choreo's declarations build resolves it
# through its built output.
- name: Build Glimmer Motion, Choreo and Choreo Player
id: build-libs
run: |
(cd packages/glimmer-motion && pnpm run build)
(cd packages/choreo && pnpm run build)
(cd packages/choreo-player && pnpm run build)
- name: Glimmer Motion test suite
if: ${{ !cancelled() && steps.build-libs.outcome == 'success' }}
run: pnpm test
working-directory: packages/glimmer-motion
env:
CHOREO_LIBS: dist
- name: Choreo test suite
if: ${{ !cancelled() && steps.build-libs.outcome == 'success' }}
run: pnpm test
working-directory: packages/choreo
env:
CHOREO_LIBS: dist
boxel-ui-raw-icon-changes-only:
name: Boxel UI ensure raw icon changes only
needs: change-check
if: needs.change-check.outputs.boxel-ui == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: boxel-ui-raw-icon-changes-only-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Rebuild boxel-ui icons
run: pnpm rebuild:icons
working-directory: packages/boxel-ui
- name: Fail if generated icons have been changed without underlying raw icon changing
run: git diff --exit-code
boxel-icons-raw-icon-changes-only:
name: Boxel Icons ensure raw icon changes only
needs: change-check
if: needs.change-check.outputs.boxel-icons == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: boxel-icons-raw-icon-changes-only-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Rebuild boxel-icons icons
run: pnpm rebuild:all
working-directory: packages/boxel-icons
- name: Fail if generated icons have been changed without underlying raw icon changing
run: git diff --exit-code
matrix-client-test:
name: Matrix Client Tests
needs: [change-check, test-web-assets]
if: needs.change-check.outputs.matrix == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3]
shardTotal: [3]
include:
# The specs under packages/matrix/tests/with-synapse/<template>/
# need a Synapse configured otherwise than the one the shards share,
# so each template's run is a job of its own, unsharded. Its
# `shardIndex` is a label naming the job and its artifacts.
- shardIndex: without-registration-token
synapseTemplate: test-without-registration-token
concurrency:
group: matrix-client-test-${{ matrix.shardIndex }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Download test web assets
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.test-web-assets.outputs.artifact_name }}
path: .test-web-assets-artifact
- name: Restore test web assets into workspace
shell: bash
run: |
shopt -s dotglob
cp -a .test-web-assets-artifact/. ./
- name: Install Playwright Browsers
# Chromium only: playwright.config.ts declares no other project and no
# spec here launches Firefox or WebKit. Fetching them anyway makes
# Playwright's host validation warn that their libraries (libgtk-4,
# libgst*, libflite*) are missing, which reads like a broken install
# rather than two browsers this suite never uses.
run: pnpm exec playwright install chromium
working-directory: packages/matrix
# Warm the test images from the GHCR mirror so the services
# below (and the Playwright synapse/smtp fixtures) start from a local
# image instead of an unauthenticated Docker Hub pull (the cause of the
# recurring registry-1.docker.io timeouts). Best-effort: a miss falls
# back to a hardened-retry Docker Hub pull.
- name: Warm test Docker images from the GHCR mirror
continue-on-error: true
uses: ./.github/actions/warm-test-images
- name: Run OIDC mapping provider unit tests
# Fast (~no boot) and stack-independent — it only needs the warmed
# Synapse image — so run it once on shard 1 rather than every shard.
if: matrix.shardIndex == 1
run: pnpm test:oidc-mapping-provider
working-directory: packages/matrix
- name: Run shard-assignment unit tests
# Guards the property the split below rests on: the shards partition
# the spec files, so every spec runs on exactly one of them. Needs
# nothing running, so once on shard 1 is enough.
if: matrix.shardIndex == 1
run: pnpm test:shard-assignment
working-directory: packages/matrix
- name: Run compact-synapse-db unit tests
# Runs the script against SQLite fixtures in temp directories. It only
# needs docker to list running containers, so once on shard 1.
if: matrix.shardIndex == 1
run: pnpm test:compact-synapse-db
working-directory: packages/matrix
- name: Start test services (icons + host dist + base realm)
run: |
MATRIX_REGISTRATION_SHARED_SECRET='xxxx' mise run test-services:matrix | tee -a /tmp/server.log &
timeout 300 bash -c 'until curl -ksf https://localhost:4200 > /dev/null && curl -sf http://localhost:4206 > /dev/null; do sleep 2; done'
- name: Run Playwright tests
run: pnpm test:group ${{ matrix.shardTotal && format('{0}/{1}', matrix.shardIndex, matrix.shardTotal) || '' }}
working-directory: packages/matrix
env:
MATRIX_SYNAPSE_TEMPLATE: ${{ matrix.synapseTemplate }}
# The services above stream their output into this job's log as the run
# goes, so the file is a second copy of what is already there — and at
# tens of thousands of lines it pushes the Playwright run's own output
# past the tail the Actions logs API will serve, which is what a failed
# shard is read from. The tail below is for a glance; the whole file is
# the realm server log artifact.
- name: Print the tail of the realm server log
if: ${{ !cancelled() }}
run: tail -n 500 /tmp/server.log
- name: Extract worker and prerender logs
if: ${{ !cancelled() }}
run: |
grep -E '^\[start:worker-base|^\[start:worker-development|^\[start:worker-test' /tmp/server.log > /tmp/worker-manager.log || true
grep -E '^\[start:prerender-dev' /tmp/server.log > /tmp/prerender-server.log || true
grep -E '^\[start:prerender-manager-dev' /tmp/server.log > /tmp/prerender-manager.log || true
grep -E '^\[start:icons' /tmp/server.log > /tmp/icon-server.log || true
grep -E '^\[start:host-dist' /tmp/server.log > /tmp/host-dist.log || true
# The log uploads below are for reading a shard after the fact. Nothing
# downstream consumes them, so losing one loses that view of this shard
# and nothing else, and a failed upload does not fail the shard. The
# blob report further down stays fatal on purpose: the merge and
# shard-timings jobs consume it, and a report that did not upload would
# publish a smaller build as a complete one rather than show as a failed
# shard.
- name: Upload realm server log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
continue-on-error: true
with:
name: matrix-test-realm-server-log-${{ matrix.shardIndex }}
path: /tmp/server.log
retention-days: 30
- name: Upload worker manager log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
continue-on-error: true
with:
name: matrix-test-worker-manager-log-${{ matrix.shardIndex }}
path: /tmp/worker-manager.log
retention-days: 30
- name: Upload prerender server log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
continue-on-error: true
with:
name: matrix-test-prerender-server-log-${{ matrix.shardIndex }}
path: /tmp/prerender-server.log
retention-days: 30
- name: Upload prerender manager log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
continue-on-error: true
with:
name: matrix-test-prerender-manager-log-${{ matrix.shardIndex }}
path: /tmp/prerender-manager.log
retention-days: 30
- name: Upload icon server log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
continue-on-error: true
with:
name: matrix-test-icon-server-log-${{ matrix.shardIndex }}
path: /tmp/icon-server.log
retention-days: 30
- name: Upload host-dist log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
continue-on-error: true
with:
name: matrix-test-host-dist-log-${{ matrix.shardIndex }}
path: /tmp/host-dist.log
retention-days: 30
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: ./.github/actions/upload-artifact-retry
with:
name: blob-report-${{ matrix.shardIndex }}
path: packages/matrix/blob-report
retention-days: 1
# Traces are evidence for a human reading a failed spec. Nothing
# downstream consumes them, so a failed upload does not fail the shard.
- name: Upload Playwright traces
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
with:
name: playwright-traces-${{ matrix.shardIndex }}
path: packages/matrix/test-results/**/trace.zip
retention-days: 30
if-no-files-found: ignore
matrix-client-merge-reports-and-publish:
name: Merge Matrix reports and publish
needs:
- change-check
- matrix-client-test
# !cancelled() makes it run even if a matrix-client-test shard fails, but still respects cancellation
if: ${{ !cancelled() && (needs.change-check.outputs.matrix == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true') }}
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: matrix-client-merge-reports-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
id-token: write
contents: write
checks: write
statuses: write
outputs:
timestamp: ${{ steps.timestampid.outputs.timestamp }}
steps:
- name: Create a timestamp as a directory to store reports in
id: timestampid
run: echo "timestamp=$(date --utc +%Y%m%d_%H%M%SZ)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge blobs into one single report
run: pnpm exec playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
uses: ./.github/actions/upload-artifact-retry
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14
- name: Set up env
env:
INPUT_ENVIRONMENT: ${{ inputs.environment }}