Repository navigation
3800 lines (3723 loc) · 187 KB
/
Copy pathci.yml
File metadata and controls
3800 lines (3723 loc) · 187 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]
pull_request:
branches: [main]
# Draft and ready PRs share path/label selection. Draft transitions do
# not change coverage and must not replace an otherwise useful run.
types: [opened, synchronize, reopened, labeled, unlabeled]
workflow_call:
inputs:
full:
type: boolean
default: false
publish:
type: boolean
default: false
spinel_revision:
type: string
default: ''
outputs:
complete:
value: ${{ jobs.ci-summary.outputs.complete }}
publication-ready:
value: ${{ jobs.compact-required.outputs.passed == 'true' && jobs.assemble-site.outputs.ready == 'true' }}
# Separate from the full-ci caller's lock: workflow_call inherits its context.
# Push-to-main is the Ruby floor plus path-owned lanes (Spinel when the
# diff owns it); the broad Spinel suite and extra-language matrix ride
# Full validation. Cancel superseded SHAs so merge trains do not stack.
# Scheduled/manual full-ci is the extra-SDK + broad Spinel ledger and
# keeps its own lock.
concurrency:
group: validation-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
# CI selects the latest patch on this MRI line. The local minimum lives in
# .ruby-version; keep both anchors aligned. Exact repro pins remain separate.
MRI_RUBY: '3.4'
# The next MRI line, exercised by compare-ruby-next as a forward-
# compatibility lane. MRI_RUBY stays the supported minimum; once this
# line has run green for a while, swap the two.
MRI_RUBY_NEXT: '4.0'
# The Rails apps the /ide/ + /playground/ demos ship (in-browser). Pinned
# so the page — and any blog post's claims about it — stay stable against
# upstream churn; bump deliberately. Each bundle embeds the app's LICENSE
# and its commit (bundle-src.mjs). Lobsters is the ruby-bench benchmark
# copy (MIT); campfire is Basecamp's ONCE Campfire (MIT) — the write+push
# app (Action Cable, turbo_stream broadcasts) and the current climb;
# Mastodon (AGPL) is the scale case.
MASTODON_SHA: 163f96cee4dea23365bff9b433871e68d20d9ee7
RUBY_BENCH_SHA: d771f81f1ce9db51376e03ca7b8e6a83160556d4
CAMPFIRE_SHA: c8f74a0b0e1e93146c4d7c1d6ac80c9079682216
# rubys/spinel-pg, the PostgreSQL driver the Spinel Db shim
# (runtime/spinel/db_pg.rb) is tested against in spinel-framework.
# Pinned like the apps above; bump deliberately.
SPINEL_PG_SHA: f48735c91aa8cde258299e1189957972667a0d1f
# spinel-redis, the Redis client the Sidekiq push runs on in a Spinel
# tree, tested against a live Redis in sidekiq-live. The same repository
# and tag the emitted spin.toml pins (src/project.rs); bump both together.
SPINEL_REDIS_REPO: rubys/spinel-redis
SPINEL_REDIS_REF: v0.3.1
jobs:
plan:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
plan: ${{ steps.plan.outputs.plan }}
jobs: ${{ steps.plan.outputs.jobs }}
extra-compare: ${{ steps.plan.outputs.extra-compare }}
compare: ${{ steps.plan.outputs.compare }}
smoke: ${{ steps.plan.outputs.smoke }}
smoke-extra: ${{ steps.plan.outputs.smoke-extra }}
extras-advisory: ${{ steps.plan.outputs.extras-advisory }}
spinel-advisory: ${{ steps.plan.outputs.spinel-advisory }}
archives: ${{ steps.plan.outputs.archives }}
wasm: ${{ steps.plan.outputs.wasm }}
site: ${{ steps.plan.outputs.site }}
publish: ${{ steps.plan.outputs.publish }}
spinel-revision: ${{ steps.plan.outputs.spinel-revision }}
spinel-tests: ${{ steps.plan.outputs.spinel-tests }}
spinel-framework-shards: ${{ steps.plan.outputs.spinel-framework-shards }}
spinel-timings: ${{ steps.plan.outputs.spinel-timings }}
steps:
- uses: actions/checkout@v7
with:
# Merge-commit parents are enough to identify the PR tree. Named
# bases that are not a parent (stale event SHA, push before) are
# fetched by the planner, not by cloning full history.
fetch-depth: 2
# The latest seconds spinel-timings saved; without them the plan falls back to ci-plan.py's tables.
- name: Restore recorded Spinel test seconds
continue-on-error: true
uses: actions/cache/restore@v6
with:
path: .ci-timings/spinel-timings.json
key: spinel-timings-${{ github.run_id }}
restore-keys: spinel-timings-
- name: Select required coverage from the event's actual tree
id: plan
env:
CI_FULL: ${{ inputs.full || false }}
CI_PUBLISH: ${{ inputs.publish || false }}
CI_SPINEL_REVISION: ${{ inputs.spinel_revision }}
CI_SPINEL_TIMINGS_FILE: .ci-timings/spinel-timings.json
GH_TOKEN: ${{ github.token }}
run: python3 scripts/ci-plan.py plan
# -------------------------------------------------------------------
# Share both fixtures through this run's artifact. First-attempt PRs
# may reuse a daily source snapshot; main/scheduled/manual/rerun builds
# always generate freshly. Store guide tests execute on either path.
# -------------------------------------------------------------------
generate-fixture:
needs: plan
runs-on: ubuntu-latest
timeout-minutes: 30
env:
BUNDLE_JOBS: '4'
steps:
- uses: actions/checkout@v7
- name: Isolate fixture gems
# Runner paths are available in steps, not in job-level env expressions.
run: |
echo "GEM_HOME=$RUNNER_TEMP/fixture-gems" >> "$GITHUB_ENV"
echo "GEM_PATH=$RUNNER_TEMP/fixture-gems" >> "$GITHUB_ENV"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.MRI_RUBY }}
- name: Identify fixture inputs
id: gems
env:
FIXTURE_RECIPE: ${{ hashFiles('bin/rh', 'scripts/create-blog', 'scripts/create-store', 'scripts/test-store', '.github/workflows/ci.yml') }}
run: |
echo "$GEM_HOME/bin" >> "$GITHUB_PATH"
platform="${ImageOS}-$(ruby -e 'print "#{RUBY_ENGINE}-#{RUBY_VERSION}-#{RUBY_PLATFORM}"')"
echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"
tools="$(ruby -rbundler -e 'print "#{Gem::VERSION}-#{Bundler::VERSION}"')"
echo "platform=${platform}-${ImageVersion}-${tools}" >> "$GITHUB_OUTPUT"
echo "fixture-key=fixture-source-v1-${RUNNER_OS}-${RUNNER_ARCH}-${platform}-${ImageVersion}-${tools}-$(date -u +%F)-${FIXTURE_RECIPE}" >> "$GITHUB_OUTPUT"
- name: Restore fixture source snapshot
id: fixture-cache
if: github.event_name == 'pull_request' && github.run_attempt == 1
continue-on-error: true
uses: actions/cache/restore@v6
with:
path: real-blog.tar.gz
key: ${{ steps.gems.outputs.fixture-key }}
- name: Select fresh generation or restored source
id: fixture
env:
RESTORED: ${{ steps.fixture-cache.outcome == 'success' && steps.fixture-cache.outputs.cache-hit == 'true' }}
run: |
if [ "$RESTORED" = true ]; then
tar -xzf real-blog.tar.gz
echo "generate=false" >> "$GITHUB_OUTPUT"
else
echo "generate=true" >> "$GITHUB_OUTPUT"
fi
- name: Cache installed fixture gems
# Weekly keys refresh dependencies only within the same runner
# image version, Ruby patch/platform and RubyGems/Bundler. Generation
# checks for the latest Rails release, even on a gem-cache hit.
continue-on-error: true
uses: actions/cache@v6
with:
# Downloaded .gem archives and documentation are not needed to use
# installed gems; omitting them keeps cache transfers smaller.
path: |
${{ env.GEM_HOME }}/bin
${{ env.GEM_HOME }}/build_info
${{ env.GEM_HOME }}/extensions
${{ env.GEM_HOME }}/gems
${{ env.GEM_HOME }}/plugins
${{ env.GEM_HOME }}/specifications
key: fixture-gems-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.gems.outputs.platform }}-${{ steps.gems.outputs.week }}
restore-keys: fixture-gems-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.gems.outputs.platform }}-
- name: Install Rails
if: steps.fixture.outputs.generate == 'true'
run: gem install rails --no-document
- name: Generate fixtures/real-blog
if: steps.fixture.outputs.generate == 'true'
run: bin/rh fixture
# The Rails Guides store rides the same artifact: the /ide/
# default app and a picker entry, so build-site and
# browser-smoke-ide bundle it without a second Rails install.
- name: Generate fixtures/store by following the guide
if: steps.fixture.outputs.generate == 'true'
run: cd fixtures && ../scripts/create-store store
- name: Run guide tests on restored store
# create-store runs these on fresh builds; a source hit is not a
# test receipt. Install its locked bundle without updating the lock.
if: steps.fixture.outputs.generate == 'false'
run: scripts/test-store
- name: Pack fixtures
if: steps.fixture.outputs.generate == 'true'
run: |
tar --exclude='fixtures/real-blog/tmp' \
--exclude='fixtures/real-blog/log' \
--exclude='fixtures/store/tmp' \
--exclude='fixtures/store/log' \
--exclude='fixtures/store/storage' \
-czf real-blog.tar.gz fixtures/real-blog fixtures/store
- name: Save fresh fixture source snapshot
# Main/full cycles never restore, but can seed the default-branch
# cache for PRs. Never save failed generation or guide-test results.
if: success() && steps.fixture.outputs.generate == 'true'
continue-on-error: true
uses: actions/cache/save@v6
with:
path: real-blog.tar.gz
key: ${{ steps.gems.outputs.fixture-key }}
- name: Upload fixture
uses: actions/upload-artifact@v7
with:
name: real-blog-fixture
path: real-blog.tar.gz
compression-level: 0
retention-days: 1
# -------------------------------------------------------------------
# The Rails Guides "Getting Started" store: built by following the
# guide (scripts/create-store, which also runs the guide's own tests),
# then analyzed. The claim this job keeps: the analyzer reports ZERO
# errors, ZERO warnings and ZERO ingest gaps on the official tutorial
# app, with no annotations — the store's nine errors (token APIs,
# Action Text's form builder, parameterized mailers), thirty-eight
# warnings (the authentication generator's shapes, Action Text's
# copied `_blob` partial) and four gaps (`.text.erb` / `.json.erb`
# templates) were all analyzer gaps, closed 2026-09-16. A new Rails
# release can change the generated code this analyzes; when that
# goes red it is the analyzer's next entry, not noise.
# -------------------------------------------------------------------
store-check:
needs: [generate-fixture, plan]
if: ${{ contains(fromJSON(needs.plan.outputs.jobs), 'store-check') }}
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-rust
- uses: Swatinem/rust-cache@v2
# generate-fixture already builds the store and runs the guide's
# Rails tests before uploading it; analyze that same source tree.
- uses: actions/download-artifact@v8
with:
name: real-blog-fixture
- name: Extract fixture
run: tar -xzf real-blog.tar.gz
- name: Look for an identical successful PR execution
id: reuse
if: github.event_name == 'pull_request'
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: python3 scripts/ci-reuse.py probe --job store-check --input fixtures/store
# Debug, not release: the analyzer claim is the same IR. On PR
# 37439350975 this job spent 95s of 113s compiling a release
# binary for a check that finishes in seconds.
- name: cargo build
id: build
if: steps.reuse.outcome != 'success' || steps.reuse.outputs.hit != 'true'
run: cargo build --locked --bin roundhouse
- name: The analyzer reports no errors, no warnings and no ingest gaps on the store
id: check
if: steps.reuse.outcome != 'success' || steps.reuse.outputs.hit != 'true'
run: |
set -euo pipefail
target/debug/roundhouse check --continue fixtures/store 2>&1 | tee /tmp/store-check.txt
grep -E "^roundhouse-check: .* 0 error\(s\), 0 warning\(s\), 0 gap-attributed note\(s\), 0 survey gap\(s\)" /tmp/store-check.txt
# Use the actual dev profile and reuse the Store library build.
# These checks also run when the Store analysis result is reused.
- name: Build the unoptimized development bench driver
run: |
python3 scripts/ci-resources.py --out "$RUNNER_TEMP/store-check-resources/dev-build" -- \
cargo build --locked --profile dev --bin emit_preview
- name: Emit every bench lane in the debug profile (scripts/bench's shape)
run: |
python3 scripts/ci-resources.py --out "$RUNNER_TEMP/store-check-resources/bench" -- \
bash -euo pipefail -c "
test -x target/debug/emit_preview
for target in typescript crystal rust python elixir go kotlin swift csharp; do
target/debug/emit_preview --target \"\$target\" fixtures/real-blog >/dev/null
done
"
- name: Record actual successful execution
id: execution
if: success() && steps.reuse.outputs.eligible == 'true' && steps.build.outcome == 'success' && steps.check.outcome == 'success'
continue-on-error: true
run: python3 scripts/ci-reuse.py record --job store-check --outcome '${{ steps.build.outcome }}' --outcome '${{ steps.check.outcome }}'
- name: Save execution receipt
if: success() && steps.execution.outcome == 'success'
continue-on-error: true
uses: actions/upload-artifact@v7
with:
name: ci-executed-store-check-${{ github.run_attempt }}
path: ${{ steps.reuse.outputs.bundle }}
retention-days: 7
if-no-files-found: error
- name: Upload Store bench resource samples
if: always()
uses: actions/upload-artifact@v7
with:
name: store-check-resources-${{ github.run_attempt }}
path: ${{ runner.temp }}/store-check-resources/
if-no-files-found: ignore
# -------------------------------------------------------------------
# Build the in-browser compiler wasm (roundhouse_wasm.wasm) from source
# and upload it as an artifact for build-site. Runs in PARALLEL with
# generate-fixture — they're independent (the wasm embeds the compiler;
# the fixture is runtime input fed in the browser). Neither producer
# waits for unit tests. Rebuilds via the in-repo vendored
# ruby-rbs-sys (wasm/vendor/ — wasm32 build support upstream-pending as
# ruby/rbs#2992), so the 3.8 MB binary is NOT committed and the published
# demos (/playground/, /studio/) always track main. The only external
# need is the WASI SDK (a manual tarball, cached here).
# -------------------------------------------------------------------
build-wasm:
needs: plan
if: ${{ contains(fromJSON(needs.plan.outputs.jobs), 'build-wasm') }}
runs-on: ubuntu-latest
# The job normally finishes in a few minutes; a hung apt install
# once rode the old 45-minute ceiling and stalled the whole
# build-site → smoke → deploy tail behind it (2026-08-19).
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/build-wasm
- name: Upload wasm artifact
uses: actions/upload-artifact@v7
with:
name: roundhouse-wasm
path: wasm/target/wasm32-wasip1/release/roundhouse_wasm.wasm
retention-days: 1
# -------------------------------------------------------------------
# Build the spinel AOT compiler from matz/spinel@master and publish
# the toolchain as an artifact. Downstream spinel-toolchain /
# spinel-compare jobs download + chmod +x and either prepend to PATH
# or pass SPINEL=.../spinel to the scaffold Makefile (runtime/spinel/
# scaffold/Makefile honors SPINEL ?= spinel).
#
# The single `spinel` binary resolves its `spinel_rbs_extract` sidecar
# and `lib/` relative to its own directory, so the tree ships as a unit.
# Resolve current master once in the planner/caller, then build that SHA.
# A failed lookup falls back to fresh master and cannot save a checkpoint.
# -------------------------------------------------------------------
spinel-build:
name: spinel-build (compiler)
needs: plan
if: ${{ contains(fromJSON(needs.plan.outputs.jobs), 'spinel-build') }}
outputs:
artifact-id: ${{ steps.toolchain.outputs.artifact-id }}
execution: ${{ steps.result.outputs.status }}
# Tracks moving matz/spinel master. Advisory (continue-on-error) on
# main/Full/unknown; ci:spinel focus sets spinel-advisory=false so the
# CORE lane is merge-gate required for the fix round.
continue-on-error: ${{ needs.plan.outputs.spinel-advisory == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 25
env:
SCCACHE_DIR: ${{ github.workspace }}/.spinel-sccache
SCCACHE_CACHE_SIZE: "256M"
# Preprocess each time: Spinel uses conditional __has_include headers.
SCCACHE_DIRECT: "false"
SCCACHE_IDLE_TIMEOUT: "0"
MAKEFLAGS: "-j4"
steps:
- uses: actions/checkout@v7
with:
repository: matz/spinel
ref: ${{ needs.plan.outputs.spinel-revision }}
path: spinel-src
- name: Set up sccache
id: sccache
# A release-download outage must not prevent the compiler from building.
continue-on-error: true
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
with:
version: v0.18.0
# Its post hook assumes installation succeeded; report stats below.
disable_annotations: true
- name: Build without compiler cache when installation fails
if: steps.sccache.outcome != 'success'
run: |
echo '::warning::sccache installation failed; building Spinel without compiler cache.'
echo 'sccache installation failed; Spinel will build without compiler cache. This is not a compiler failure or a skipped build.' >> "$GITHUB_STEP_SUMMARY"
# Explicitly bypass even a preinstalled or partially installed cache.
echo 'NO_CCACHE=1' >> "$GITHUB_ENV"
- name: Restore Spinel compiler cache
if: steps.sccache.outcome == 'success'
# Persist only sccache's C compilation store, not build outputs.
# A new key saves refreshed entries as unpinned Spinel advances;
# sccache validates compiler, flags, source and header contents.
uses: actions/cache@v6
with:
path: ${{ env.SCCACHE_DIR }}
key: spinel-sccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: spinel-sccache-${{ runner.os }}-${{ runner.arch }}-
- name: Start sccache server
if: steps.sccache.outcome == 'success'
# Spinel's common.mk selects sccache automatically when on PATH.
run: sccache --start-server
- name: make deps (fetch vendored libprism)
run: make -C spinel-src deps
- name: make all
run: make -C spinel-src all
- name: Show compiler cache statistics
if: steps.sccache.outcome == 'success'
run: sccache --show-stats
- name: Stage artifact tree
# `make all` now builds a single `spinel` binary (a top-level symlink
# to bin/spinel) plus the `spinel_rbs_extract` sidecar under build/;
# the legacy spinel_parse/spinel_analyze/spinel_codegen split moved
# under legacy/ and is no longer produced. (The build also emits
# bin/spinel-{doctor,reduce,flatten}, which roundhouse doesn't ship.)
# The single binary locates both `spinel_rbs_extract` and `lib/`
# relative to the directory it is invoked from, so they must ship
# alongside it. The extractor is REQUIRED for the --rbs path
# (spinel-toolchain / spinel-compare); without it, --rbs is silently
# a no-op and the seeded path goes untested. `cp -L` dereferences the
# symlink to copy the real binary.
# `spin` (spinel's project tool, a native binary spinel compiles
# from tools/spin.rb) ships too: the spinel archive is a spin
# package and spinel-smoke's README blocks drive `spin build` /
# `spin test`. spin locates the compiler as its PATH sibling.
# `packages/` ships as well: the compiler resolves bundled spin
# packages (json, set, …) at `<lib-parent>/packages` — a plain
# `require "json"` in runtime code (runtime/spinel/json.rb since
# 72029f0a) silently resolves NOTHING without it, and every
# spinel job goes red on `undefined method 'generate'`.
# `builtins/` is the same lesson a third time: since spinel
# 50e2d7bf the core Enumerable methods (`partition`, `group_by`,
# `each_with_object`, …) are Ruby in `builtins/enumerable.rb`,
# spliced by the compiler from `<lib-parent>/builtins`, and their
# C emitters are gone. A toolchain staged without the directory
# compiles SILENTLY with no such methods: campfire's two
# `relation.partition { }` sites became an unconditional
# `undefined method 'partition' for an instance of Array` whose
# carrier failed the C build (`sp_int` into `sp_PolyArray *`),
# while the same emit built clean from any full checkout — a day
# spent on a spinel regression that was this `cp`. Upstream's own
# `make install` ships it; this list must mirror that target.
run: |
mkdir spinel-dist
cp -L spinel-src/spinel spinel-dist/spinel
cp spinel-src/bin/spin spinel-dist/spin
cp spinel-src/build/spinel_rbs_extract spinel-dist/
cp -R spinel-src/lib spinel-dist/lib
cp -R spinel-src/packages spinel-dist/packages
cp -R spinel-src/builtins spinel-dist/builtins
git -C spinel-src rev-parse HEAD > spinel-dist/revision.txt
- name: Upload spinel toolchain
id: toolchain
uses: actions/upload-artifact@v7
with:
name: spinel-dist
path: spinel-dist
retention-days: 1
- &advisory-result
name: Report actual advisory execution
id: result
if: always()
env:
STATUS: ${{ job.status }}
run: echo "status=$STATUS" >> "$GITHUB_OUTPUT"
# -------------------------------------------------------------------
# Library correctness. Runs the default (non-ignored) test suite:
# ingest / analyze / IR round-trip / per-target emit snapshot tests.
# -------------------------------------------------------------------
unit-build:
needs: generate-fixture
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
unit-test-artifact-id: ${{ steps.unit-tests.outputs.artifact-id }}
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
ROUNDHOUSE_TEST_BUNDLE_ROOT: ${{ github.workspace }}
# Keep backtrace line data inside the archived executables.
CARGO_PROFILE_TEST_SPLIT_DEBUGINFO: "off"
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-rust
- uses: Swatinem/rust-cache@v2
- uses: ./.github/actions/setup-nextest
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.MRI_RUBY }}
- uses: actions/download-artifact@v8
with:
name: real-blog-fixture
- name: Extract fixture
run: tar -xzf real-blog.tar.gz
- name: Build the complete test archive and inventory
run: |
python3 scripts/ci-resources.py --out "$RUNNER_TEMP/unit-build-resources/build" -- \
python3 scripts/ci-unit-tests.py build \
--archive "$RUNNER_TEMP/unit-tests/unit-tests.tar.zst" \
--inventory "$RUNNER_TEMP/unit-tests/inventory.json" --shard-count 4
- name: Check documentation tests
run: |
python3 scripts/ci-resources.py --out "$RUNNER_TEMP/unit-build-resources/docs" -- \
cargo test --locked --doc \
--config 'profile.test.package.roundhouse.opt-level=0'
- name: Upload current-run test bundle
id: unit-tests
uses: actions/upload-artifact@v7
with:
name: unit-test-bundle
overwrite: true
path: |
${{ runner.temp }}/unit-tests/unit-tests.tar.zst
${{ runner.temp }}/unit-tests/inventory.json
if-no-files-found: error
retention-days: 1
- name: Upload test build timings
if: always()
uses: actions/upload-artifact@v7
with:
name: unit-build-timings-${{ github.run_attempt }}
path: target/cargo-timings/
if-no-files-found: ignore
- name: Upload unit build resource samples
if: always()
uses: actions/upload-artifact@v7
with:
name: unit-build-resources-${{ github.run_attempt }}
path: ${{ runner.temp }}/unit-build-resources/
if-no-files-found: ignore
unit:
needs: [generate-fixture, unit-build]
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
# A failed partition must not cancel the remaining coverage.
fail-fast: false
max-parallel: 4
matrix:
shard: [0, 1, 2, 3]
env:
# Existing tests embed source and helper-binary paths at compile time.
# Match the producer's checkout and extraction paths exactly.
CARGO_TARGET_DIR: ${{ github.workspace }}/target
steps:
- uses: actions/checkout@v7
# Some test bodies build isolated Rust fixtures, so keep Cargo available.
- uses: ./.github/actions/setup-rust
- uses: Swatinem/rust-cache@v2
- uses: ./.github/actions/setup-nextest
- uses: actions/download-artifact@v8
with:
name: real-blog-fixture
- name: Extract fixture
run: tar -xzf real-blog.tar.gz
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.MRI_RUBY }}
# These gates exercise the actual gems, not optional runtime fallbacks.
- name: System libvips for the emitted ruby-vips processor
timeout-minutes: 20
run: |
"$GITHUB_WORKSPACE/scripts/ci-apt-install" libvips42
- name: Install gems used by emitted Ruby and Campfire harness tests
run: |
gem install --no-document rails-html-sanitizer sqlite3 bcrypt rack ruby-vips markly faraday faraday-multipart faraday-retry retryable jwt
gem install --no-document activerecord -v '~> 8.1.0'
- name: Download current-run test bundle
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.unit-build.outputs.unit-test-artifact-id }}
merge-multiple: true
path: ${{ runner.temp }}/unit-tests
- name: Validate coverage and run this test partition
run: |
python3 scripts/ci-resources.py --out "$RUNNER_TEMP/unit-resources/tests" -- \
python3 scripts/ci-unit-tests.py run \
--archive "$RUNNER_TEMP/unit-tests/unit-tests.tar.zst" \
--inventory "$RUNNER_TEMP/unit-tests/inventory.json" \
--shard-index ${{ strategy.job-index }} --shard-count ${{ strategy.job-total }} \
--report "$RUNNER_TEMP/unit-resources/tests/shard.json"
- name: Upload unit test results
if: always()
uses: actions/upload-artifact@v7
with:
name: unit-test-results-${{ matrix.shard }}-${{ github.run_attempt }}
path: target/nextest/ci/junit.xml
if-no-files-found: ignore
- name: Upload unit resource samples
if: always()
uses: actions/upload-artifact@v7
with:
name: unit-resources-${{ matrix.shard }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/unit-resources/
if-no-files-found: ignore
# Only selected consumers need this compiler. Produce it without waiting
# for fixtures/tests; their success remains independently required at the gate.
build-roundhouse:
needs: plan
if: ${{ contains(fromJSON(needs.plan.outputs.jobs), 'build-roundhouse') }}
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
roundhouse-bin-artifact-id: ${{ steps.roundhouse-bin.outputs.artifact-id }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-rust
- uses: Swatinem/rust-cache@v2
# Keep the historical dev profile for Campfire, not a release substitute.
# Consumers must set ROUNDHOUSE_BIN so the harness does not rebuild it.
- name: Stage current-run debug roundhouse binary
run: |
set -euo pipefail
cargo build --locked --bin roundhouse
test -x target/debug/roundhouse
mkdir -p roundhouse-debug-bin
cp -L target/debug/roundhouse roundhouse-debug-bin/roundhouse
chmod +x roundhouse-debug-bin/roundhouse
{
echo "source_sha=${GITHUB_SHA}"
echo "profile=debug"
echo "binary=roundhouse"
echo "producer_job=build-roundhouse"
echo "rustc_host=$(rustc -vV | awk '/^host:/{print $2}')"
echo "rustc_release=$(rustc -vV | awk '/^release:/{print $2}')"
./roundhouse-debug-bin/roundhouse --version | sed 's/^/version=/'
} | tee roundhouse-debug-bin/identity.txt
- name: Upload current-run debug roundhouse binary
id: roundhouse-bin
uses: actions/upload-artifact@v7
with:
name: roundhouse-debug-bin
path: roundhouse-debug-bin
retention-days: 1
# -------------------------------------------------------------------
# One job per target language. Each generates a project from the
# fixtures in-process and runs the target's real toolchain over it.
#
# SHRUNK by the smoke consolidation (see the smoke-<target> matrix):
# the smoke jobs run each archive's full build + model/controller
# test + Playwright legs from the published tgz, so toolchain jobs
# whose only coverage was real-blog build/test (go, rust, kotlin,
# swift) are retired — their harnesses remain as dev-loop tools
# (cargo test --test <t>_toolchain -- --ignored). The survivors stay
# for coverage smoke can't reach: tiny-blog gates (crystal, elixir,
# python — the absent-feature shape real-blog can't test) and
# typescript's dual-profile tsc + node:test (async coloring). Those
# survivors and the framework-tests-* suites now run as steps of the
# per-target `compare` job (#273).
# -------------------------------------------------------------------
# Browser smoke for the TypeScript *SharedWorker* deployment profile
# (juntos) — distinct from the tsx-server smoke-typescript job below.
# Harness + README live in tests/browser_smoke/. The pipeline (driven
# by `npm test` → scripts/prebuild.mjs → playwright.config.ts):
# 1. emit real-blog under `--profile worker` (cargo run emit_preview),
# 2. npm install + vite-build the emitted SPA into .emitted/dist,
# 3. `npm run preview` serves it; Playwright drives headless Chromium.
# The spec opens its OWN SharedWorker port and dispatches synthetic
# GET/POST/DELETE/422 requests + a multi-tab BroadcastChannel probe,
# asserting no 5xx. This is the only job that exercises the emitted
# framework runtime *inside a SharedWorker*, so it catches portability
# gaps the server target can't see: Node-only globals (Buffer/process/
# require) in transpiled output, missing browser polyfills, broken
# MessagePort / BroadcastChannel wiring, installDb ordering. Builds
# from source (needs generate-fixture, like toolchain-typescript),
# NOT from the published archive. Playwright config gates on $CI
# (GitHub sets it) → fresh server + forbidOnly + github reporter.
browser-smoke-typescript:
needs: [generate-fixture, plan]
if: ${{ contains(fromJSON(needs.plan.outputs.jobs), 'browser-smoke-typescript') }}
runs-on: ubuntu-latest
timeout-minutes: 25
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v7
- name: Use an explicit browser payload directory
run: echo "PLAYWRIGHT_BROWSERS_PATH=$RUNNER_TEMP/ci-reuse-browsers" >> "$GITHUB_ENV"
- uses: ./.github/actions/setup-rust
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v8
with:
name: real-blog-fixture
- name: Extract fixture
run: tar -xzf real-blog.tar.gz
- name: Install Node
uses: actions/setup-node@v7
with:
node-version: '24'
# Warm downloads for the generated app, not node_modules or dist.
cache: npm
cache-dependency-path: |
tests/browser_smoke/package-lock.json
src/emit/typescript/package.rs
- name: Install harness deps
run: $GITHUB_WORKSPACE/scripts/ci-npm ci
working-directory: tests/browser_smoke
- name: Install Playwright Chromium (+ system deps)
run: $GITHUB_WORKSPACE/scripts/ci-playwright-install
working-directory: tests/browser_smoke
- name: Emit and build current SharedWorker project
run: npm run prebuild
working-directory: tests/browser_smoke
- name: Find successful execution for identical SharedWorker inputs
id: reuse
if: github.event_name == 'pull_request'
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: python3 scripts/ci-reuse.py probe --job browser-smoke-typescript --input tests/browser_smoke/.emitted
- name: Run SharedWorker browser smoke (emit → vite build → drive)
id: browser
if: steps.reuse.outcome != 'success' || steps.reuse.outputs.hit != 'true'
run: npm run test-only
working-directory: tests/browser_smoke
- name: Record actual SharedWorker validation
id: execution
if: success() && steps.reuse.outputs.eligible == 'true' && steps.reuse.outcome == 'success' && steps.browser.outcome == 'success'
continue-on-error: true
run: python3 scripts/ci-reuse.py record --job browser-smoke-typescript --outcome '${{ steps.browser.outcome }}'
- name: Upload SharedWorker execution receipt
if: success() && steps.execution.outcome == 'success'
continue-on-error: true
uses: actions/upload-artifact@v7
with:
name: ci-executed-browser-smoke-typescript-${{ github.run_attempt }}
path: ${{ steps.reuse.outputs.bundle }}
retention-days: 7
- name: Upload Playwright report on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: browser-smoke-playwright-report
path: |
tests/browser_smoke/playwright-report
tests/browser_smoke/test-results
retention-days: 7
if-no-files-found: ignore
# The /ide/ demo, driven in a real chromium: analyze the pinned
# Mastodon bundle in the wasm worker, then assert the demo beats —
# typed hover (@account → Account, incl. inside a HAML template),
# typed completion (@status. → account: Account?), related files via
# the inferred render graph, and the coverage ledger being on. This
# regression-guards the published demo (and the blog post's claims):
# a change that mutes any beat fails CI before it reaches Pages.
# Deterministic inputs (pinned SHA + fresh wasm), so blocking.
browser-smoke-ide:
needs: [build-wasm, generate-fixture]
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: roundhouse-wasm
path: wasm/lib
- uses: actions/download-artifact@v8
with:
name: real-blog-fixture
- name: Extract fixture
run: tar -xzf real-blog.tar.gz
- name: Install Node
uses: actions/setup-node@v7
with:
node-version: '24'
- name: Cache Mastodon source bundle
id: mastodon-src
uses: actions/cache@v6
with:
path: wasm/ide/app-src.json
key: mastodon-app-src-${{ env.MASTODON_SHA }}-v2
- name: Fetch pinned Mastodon + bundle sources
if: steps.mastodon-src.outputs.cache-hit != 'true'
run: |
set -euo pipefail
curl -fsSL "https://codeload.github.com/mastodon/mastodon/tar.gz/${MASTODON_SHA}" -o /tmp/mastodon.tar.gz
mkdir -p /tmp/mastodon && tar -xzf /tmp/mastodon.tar.gz -C /tmp/mastodon --strip-components=1
node wasm/ide/bundle-src.mjs /tmp/mastodon wasm/ide/app-src.json \
--name mastodon --commit "${MASTODON_SHA}" \
--open app/controllers/statuses_controller.rb
# The other two picker apps, so verify-ide.mjs can exercise the app
# switch (blog + lobsters + mastodon). Mirrors the build-site assembly.
- name: Cache lobsters source bundle
id: lobsters-src
uses: actions/cache@v6
with:
path: /tmp/app-lobsters.json
key: lobsters-app-src-${{ env.RUBY_BENCH_SHA }}-v1
- name: Fetch pinned ruby-bench + bundle lobsters (cache miss)
if: steps.lobsters-src.outputs.cache-hit != 'true'
run: |
set -euo pipefail
curl -fsSL "https://codeload.github.com/ruby/ruby-bench/tar.gz/${RUBY_BENCH_SHA}" -o /tmp/ruby-bench.tar.gz
mkdir -p /tmp/lobsters
tar -xzf /tmp/ruby-bench.tar.gz -C /tmp/lobsters --strip-components=3 "ruby-bench-${RUBY_BENCH_SHA}/benchmarks/lobsters"
node wasm/ide/bundle-src.mjs /tmp/lobsters /tmp/app-lobsters.json \
--name lobsters --commit "${RUBY_BENCH_SHA}" \
--open app/controllers/stories_controller.rb
- name: Cache campfire source bundle
id: campfire-src
uses: actions/cache@v6
with:
path: /tmp/app-campfire.json
key: campfire-app-src-${{ env.CAMPFIRE_SHA }}-v1
- name: Fetch pinned once-campfire + bundle sources (cache miss)
if: steps.campfire-src.outputs.cache-hit != 'true'
run: |
set -euo pipefail
curl -fsSL "https://codeload.github.com/basecamp/once-campfire/tar.gz/${CAMPFIRE_SHA}" -o /tmp/campfire.tar.gz
mkdir -p /tmp/campfire && tar -xzf /tmp/campfire.tar.gz -C /tmp/campfire --strip-components=1
node wasm/ide/bundle-src.mjs /tmp/campfire /tmp/app-campfire.json \
--name campfire --commit "${CAMPFIRE_SHA}" \
--open app/models/message.rb
- name: Assemble picker bundles + manifest
run: |
set -euo pipefail
node wasm/ide/bundle-src.mjs fixtures/real-blog wasm/ide/app-blog.json \
--name blog --open app/controllers/articles_controller.rb
node wasm/ide/bundle-src.mjs fixtures/store wasm/ide/app-store.json \
--name store --open app/views/products/index.html.erb
node wasm/ide/bundle-src.mjs fixtures/roda-blog wasm/lib/app-roda.json \
--name roda-blog --open app.rb
cp /tmp/app-lobsters.json wasm/ide/app-lobsters.json
cp /tmp/app-campfire.json wasm/ide/app-campfire.json
printf '%s\n' '{"default":"store","apps":[{"name":"store","label":"Rails Guides store","src":"app-store.json"},{"name":"blog","label":"Rails blog","src":"app-blog.json"},{"name":"lobsters","label":"Lobsters","src":"app-lobsters.json"},{"name":"campfire","label":"Campfire","src":"app-campfire.json"},{"name":"mastodon","label":"Mastodon","src":"app-src.json"}]}' > wasm/ide/apps.json
# Playground picker (lib/): lobsters + mastodon alongside the committed
# blog fixture, so verify-playground exercises the app switch + the
# off-thread Mastodon transpile.
cp /tmp/app-lobsters.json wasm/lib/app-lobsters.json
cp /tmp/app-campfire.json wasm/lib/app-campfire.json
cp wasm/ide/app-src.json wasm/lib/app-mastodon.json
printf '%s\n' '{"default":"blog","apps":[{"name":"blog","label":"Rails blog","src":"fixture.json","open":"app/models/article.rb"},{"name":"roda","label":"Roda + Sequel blog","src":"app-roda.json","open":"app.rb"},{"name":"lobsters","label":"Lobsters","src":"app-lobsters.json","open":"app/models/story.rb"},{"name":"campfire","label":"Campfire","src":"app-campfire.json","open":"app/models/message.rb"},{"name":"mastodon","label":"Mastodon","src":"app-mastodon.json","open":"app/models/status.rb"}]}' > wasm/lib/apps.json
- name: Install harness deps (Playwright)
run: $GITHUB_WORKSPACE/scripts/ci-npm ci
working-directory: tests/browser_smoke
- name: Install Playwright Chromium (+ system deps)
run: $GITHUB_WORKSPACE/scripts/ci-playwright-install
working-directory: tests/browser_smoke
- name: Serve wasm/ and verify the /ide/ + /playground/ + /studio/ + /fractal/ pages
run: |
set -euo pipefail
(cd wasm && python3 -m http.server 8099 >/tmp/ide-server.log 2>&1 &)
sleep 1
(cd wasm/ide && node verify-ide.mjs)
# Same shared worker/client, exercised through the emit surface incl.
# the off-thread Mastodon transpile.
(cd wasm/playground && node verify-playground.mjs)
# Studio: runs the emitted blog + its Minitest suite in-browser over
# wasm/lib/test-runtime.mjs — the in-memory Db shim that once drifted
# off the `_opt` seam unseen because nothing here ran it.
(cd wasm/studio && node verify-studio.mjs)
# Fractal's pass explorer, over the same worker's fractal_stages export.
(cd wasm/fractal && node verify-fractal.mjs)
# Per-target framework-test conformance gate for the spinel AOT
# target. Same emit pipeline as framework-tests-ruby, but each
# emitted test is compiled to a native binary via `spinel --rbs sig
# <file>.rb -o <bin>` and executed; the autorun shim returns
# non-zero on any assertion failure.
#
# Status (2026-06-02, spinel a782696): all 5 expected green locally.
# matz/spinel #915 (the old `return NULL` blocker named in earlier
# revisions of this comment) has landed, so errors/ac_base/router/
# inflector pass. The `view_helpers` stand-in previously hit two
# spinel mis-compiles of the inline `Article < ActiveRecord::Base`;
# both are now worked around roundhouse-side:
# (a) the `Article` ctor's `id` param was widened to sp_RbVal because
# the inherited `ActiveRecord::Base.create(attrs={})` factory
# calls `new(attrs)` with a Hash — spinel unifies that poly call
# site with `Article.new(7)` (Integer) into one C param type. The
# body `self.id = id` then inlined the inherited attr_accessor
# setter as a direct write to the narrow `mrb_int` id field, so
# `mrb_int = sp_RbVal` failed to compile. Filed as matz/spinel#1275
# with a 19-line standalone repro (no RBS; the optional default
# and the `?Integer` RBS are both red herrings — a required param
# reproduces identically). WORKED AROUND: the stand-in now assigns
# `@id = id` (direct ivar write) instead of `self.id = id`; the
# direct-write path widens the field to match, so all four targets
# (ruby/crystal/ts/spinel) agree. Real generated models are
# unaffected — they use the Hash-`attrs` ctor shape, which doesn't
# trigger the unification. The spinel-side fix still tracked in #1275.
# (b) the `[]` field-lookup returns Integer|String across branches
# and spinel commits to one C type instead of boxing — filed as
# matz/spinel#1255 (clean minimal repro). ADDRESSED roundhouse-
# side: inner test stand-ins now emit an `.rbs` sidecar
# (`sig/test/<stem>_inner.rbs`) with `def []: ... -> (Integer |
# String)`, the annotation the issue's own repro confirms makes
# spinel box. So (b) no longer needs the spinel fix and no longer
# appears in the log.
# #1275 and #1255 have since closed upstream (2026-07 audit); (a)'s
# direct ivar write is idiomatic-ctor Ruby and (b)'s sidecar is typed
# surface we want anyway, so neither is reverted. continue-on-error
# stays ON for the same structural reason as spinel-toolchain below:
# every spinel job tracks matz/spinel master UNPINNED, so it surfaces
# regressions without letting upstream churn gate unrelated work.
# `ar_base` is disabled in-test (b453fcf) pending real-sqlite
# rewiring of the test_helper.
spinel-framework:
name: spinel-framework (suite, ${{ matrix.shard }})
# Needs the real-blog fixture: date_columns_spinel overlays it.
# Advisory unless ci:spinel focus hardens CORE (+ this suite).
needs: [generate-fixture, spinel-build, plan]
if: ${{ !cancelled() && contains(fromJSON(needs.plan.outputs.jobs), 'spinel-framework') && needs.generate-fixture.result == 'success' && needs.spinel-build.outputs.artifact-id != '' }}
# The plan balances the selected suites over up to four shards by their
# recorded durations; each shard reports its own output key, as
# spinel-toolchain's do.
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.spinel-framework-shards) }}
outputs:
shard-0: ${{ steps.result.outputs.shard-0 }}
shard-1: ${{ steps.result.outputs.shard-1 }}
shard-2: ${{ steps.result.outputs.shard-2 }}
shard-3: ${{ steps.result.outputs.shard-3 }}
runs-on: ubuntu-latest
# 30m: upstream's shards take 11-14m, but a fork's runners take about
# 1.7x that (a 20m bound cut a passing shard 2 there, fork run
# 38923600903). Still short of papering over a hung suite.
timeout-minutes: 30
continue-on-error: ${{ needs.plan.outputs.spinel-advisory == 'true' }}
# spinel_pg_db runs the PostgreSQL Db shim against this server.
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
options: >-
--health-cmd pg_isready --health-interval 5s
--health-timeout 5s --health-retries 10
env:
MAKEFLAGS: "-j4"
# Not the test profile's opt-level 1, as in spinel-toolchain: Spinel and cc are the run here.
CARGO_PROFILE_TEST_OPT_LEVEL: "0"
steps:
- uses: actions/checkout@v7
- name: Check out spinel-pg (pinned)
if: ${{ contains(matrix.tests, 'spinel_pg_db') }}
uses: actions/checkout@v7
with:
repository: rubys/spinel-pg
ref: ${{ env.SPINEL_PG_SHA }}
path: spinel-pg
# Not the runner's system Ruby: a suite compares the binary with CRuby, and the baseline's messages are 3.4's
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.MRI_RUBY }}
- uses: ./.github/actions/setup-rust
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v8
with:
name: real-blog-fixture
- name: Extract fixture
run: tar -xzf real-blog.tar.gz
- uses: actions/download-artifact@v8
with:
name: spinel-dist
path: spinel-dist
- name: Stage spinel binaries
run: |
chmod +x spinel-dist/spinel spinel-dist/spin spinel-dist/spinel_rbs_extract
echo "$PWD/spinel-dist" >> $GITHUB_PATH
# Full runs select all native suites; targeted runs select their owners.
# Continue after a failing suite without losing its failure status.
- name: Run selected native framework checks
env:
TESTS: ${{ join(matrix.tests, ' ') }}
# Inputs of spinel_pg_db only; it fails without them.
SPINEL_PG_DIR: ${{ github.workspace }}/spinel-pg
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/postgres
CI_SPINEL_TIMINGS_OUT: ${{ runner.temp }}/spinel-timings/framework-${{ matrix.shard }}.jsonl
run: |
test -n "$TESTS"
status=0
for suite in $TESTS; do
timed=(python3 scripts/ci-plan.py timed --kind framework --name "$suite" --)