-
-
Notifications
You must be signed in to change notification settings - Fork 156
2780 lines (2570 loc) · 134 KB
/
Copy pathtest.yml
File metadata and controls
2780 lines (2570 loc) · 134 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: Tests
on:
# Run on version tags so `release-packages.yml` can gate publish on a green
# Tests workflow for the exact commit being released. Direct pushes to main
# do NOT trigger tests — the gates that matter are PRs (pre-merge) and tags
# (pre-release).
push:
tags: ['v*']
pull_request:
branches: [main]
# `labeled` is here so the optional opt-in jobs (parity, compile-smoke,
# doc-tests) re-fire when a maintainer or the PR author applies the
# `run-extended-tests` label. Without it, applying the label on an
# existing PR wouldn't re-trigger the workflow.
types: [opened, synchronize, reopened, labeled]
paths-ignore:
- 'docs/src/**'
- '*.md'
- '!CLAUDE.md'
- '!CHANGELOG.md'
schedule:
# Nightly full-workspace cargo-test safety net (04:00 UTC). The per-PR
# cargo-test gate only exercises crates affected by the diff
# (scripts/ci_test_scope.py); a cross-crate regression that slips a scoped
# PR is caught here within a day. `schedule` is not `pull_request`, so the
# cargo-test job runs the full workspace.
- cron: '0 4 * * *'
# Manual escape hatch for the opt-in jobs. Maintainers (write access)
# can dispatch the workflow against any ref with `run_extended_tests=true`
# to run parity / compile-smoke / package smokes / doc-tests on demand
# without tagging a release.
workflow_dispatch:
inputs:
run_extended_tests:
description: 'Run extended tests (parity, compile-smoke, package smokes, doc-tests)'
type: boolean
default: false
# Superseded PR pushes cancel their in-flight run (the real minute saver); the
# nightly cron and release-tag runs never do (#5960). Keying the group on the
# event as well as the ref means a manual `workflow_dispatch` on `main` — the
# only other run that shares `refs/heads/main` with the cron, since pushes to
# main don't trigger this workflow — can't cancel a nightly mid-flight, and
# `cancel-in-progress` is off for those events regardless. The nightly is the
# only backstop for integration-suite regressions a scoped PR run can't see, so
# it must always reach a conclusion.
concurrency:
group: test-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
MACOSX_DEPLOYMENT_TARGET: "13.0"
jobs:
# ---------------------------------------------------------------------------
# Changeset gate: PRs touching crates/ must ship changelog.d/<PR>-<slug>.md
# (see changelog.d/README.md; fragments fold into GitHub Release notes at
# tag time via scripts/cut_release_notes.sh — CHANGELOG.md is frozen).
# Standalone job, NOT a step inside `lint`, so it can be its own required
# status check: lint carries unrelated red debt that gets admin-bypassed,
# and this gate must not ride along with that. The `skip-changelog` label
# skips it (the `labeled` trigger above refires the workflow, and a skipped
# required check counts as satisfied).
# ---------------------------------------------------------------------------
changeset-gate:
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip-changelog')
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require a changelog.d/ fragment for crates/ changes
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" --paginate > files.json
jq -r '.[].filename' files.json | grep -q '^crates/' || { echo "No crates/ changes — gate not applicable."; exit 0; }
# The fragment must be ADDED in this PR (editing a leftover file
# doesn't count) and match the root-level <digits>-<slug>.md shape
# cut_release_notes.sh folds at release time.
jq -r '.[] | select(.status == "added") | .filename' files.json | grep -qE '^changelog\.d/[0-9]+-[^/]+\.md$' && exit 0
echo "::error::This PR changes crates/ but adds no changelog.d/ fragment. Add changelog.d/<PR>-<slug>.md (see changelog.d/README.md) or apply the 'skip-changelog' label."
exit 1
# ---------------------------------------------------------------------------
# Lint: cargo fmt --check (formatting gate for every PR)
# ---------------------------------------------------------------------------
lint:
# Was macos-14 — moved to ubuntu-latest in v0.5.428 since `cargo fmt
# --check` is portable. The 6 multiplier-min cut is small in absolute
# terms (lint runs in ~30s) but it's free.
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- name: Setup Node.js for benchmark harness tests
uses: actions/setup-node@v7
with:
# Kept in lockstep with benchmark.yml's peer-comparison Node via the
# shared .node-version pin — these harness tests exercise the same
# comparison scripts that job runs.
node-version-file: .node-version
- name: Validate benchmark artifact and fallback gates
run: |
python3 -m unittest discover -s tests -p 'test_benchmark_gate.py' -v
./tests/test_benchmark_peer_fallback.sh
./tests/test_benchmark_output_verifier.sh
bash -n benchmarks/compare.sh benchmarks/honest_bench/run.sh \
benchmarks/honest_bench/harness/run_http_bench.sh \
tests/test_benchmark_peer_fallback.sh
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: ./.github/actions/setup-llvm22
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
# PRs read from cache; only main writes new entries.
# Avoids cache thrash from short-lived branches.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check formatting
if: ${{ !cancelled() }}
run: cargo fmt --all -- --check
- name: Audit workspace architecture
if: ${{ !cancelled() }}
run: |
python3 scripts/workspace_architecture.py --self-test
python3 scripts/workspace_architecture.py --check --print-summary
- name: Public benchmark evidence freshness
if: ${{ !cancelled() }}
run: |
PYTHONPATH=. python3 tests/test_public_baseline.py
# README embedded table is optional since #6736 (marketing landing
# page); this wrapper still enforces artifact freshness + RESULTS.md
# drift. Kept out of public_baseline.py to preserve harness_fingerprint.
python3 benchmarks/ci_public_baseline_check.py
# File-size gate (v0.5.1019): fails the PR if any tracked source
# file exceeds the LOC threshold (5000 initially; eventual target
# is 2000). Big single-file modules are hard to read, slow IDE +
# cargo-check incrementality, and hide regressions in code review.
# Allowlist + exclusions live in the script.
- name: File size limit
if: ${{ !cancelled() }}
run: ./scripts/check_file_size.sh
# Well-known binding provenance pins: every third-party binding in
# well_known_bindings.toml must carry an [bindings.<name>.upstream]
# pin, and the lock-step rule (ported-at == version) must hold, so a
# pin bump can't outrun the wrapper review it demands. Offline/CI-safe
# (no network); the weekly update runs `--check --refresh` to surface
# newly-soaked upstream releases as advisories.
- name: Binding upstream pins (lock-step)
if: ${{ !cancelled() }}
run: node scripts/binding_pins.mjs --check
# GC write-barrier store-site inventory: every raw heap-slot store in
# perry-codegen / perry-runtime / perry-stdlib must be barriered or
# carry a justified GC_STORE_AUDIT(...) marker (or a justified entry
# in scripts/gc_store_site_allowlist.txt). Catches new unbarriered
# old->young store paths before they become nondeterministic segfaults.
- name: GC store-site inventory
if: ${{ !cancelled() }}
run: |
python3 scripts/gc_store_site_inventory.py --self-test
python3 scripts/gc_store_site_inventory.py
# Handle-vs-pointer address classification audit: POINTER_TAG payloads
# can be heap pointers OR small registry handles (fetch/zlib/proxy/...),
# and code must classify by magnitude through value/addr_class.rs before
# dereferencing. Catches new hand-typed band literals (0x100000 etc.)
# and new `as *const GcHeader` casts outside addr_class.rs / gc/ before
# they become Linux-only segfaults (#1843, #4004, #4665, #4800 class).
# Allowlist: scripts/addr_class_allowlist.txt.
- name: Address-classification audit
if: ${{ !cancelled() }}
run: |
python3 scripts/addr_class_inventory.py --self-test
python3 scripts/addr_class_inventory.py
# Two reserved class ids sharing a value is silent and destructive: every
# dispatch tower matches them in a fixed order, so the later arm becomes
# unreachable and its whole method surface dies (#7576 killed the entire
# TC39 iterator-helpers proposal that way), and any site discriminating on
# class_id ALONE cross-matches — which can look correct for as long as the
# two types agree on field layout and break the day either changes (#7587,
# where `String(JSON.rawJSON(x))` was silently taking the JSX path).
#
# This SCANS rather than enumerating. #7576 shipped a Rust test listing
# seven iterator ids, which is good and stays — but it could not catch
# #7587, a different family that was not in the list. A gate whose
# coverage depends on the same attention the bug depends on is not a gate.
- name: Class-id collision audit
if: ${{ !cancelled() }}
run: python3 scripts/class_id_collisions.py
# #7645. The copying minor skips its eligibility preflight — the walk that
# proves nothing reachable is pinned — whenever the young-pin latch is
# clear. That is sound only while EVERY creation of GC_FLAG_PINNED goes
# through gc::pin_object, which is what arms the latch; a pin created any
# other way lets the collector relocate a pinned object whose holder keeps
# a raw address no scanner rewrites. This SCANS for both shapes the tree
# has used — `gc_flags |= GC_FLAG_PINNED` and the raw `*gc_flags_ptr |=
# 0x04` that hid two of the six pin sites from every grep — and fails on a
# stale allowlist entry as well as on a new site.
- name: GC pin-site custody audit
if: ${{ !cancelled() }}
run: |
python3 scripts/gc_pin_sites.py --self-test
python3 scripts/gc_pin_sites.py
# #7231. A runtime-side table holding a GC pointer IS a root, and nothing
# static could see that class before: gc_root_dominance_check.py reads
# emitted LLVM IR and a thread_local is not in it. #7226, #7239, #7268 and
# #7274 were all found by hand, each one re-deriving the same enumeration.
# This is that enumeration with a verdict required per holder — an
# unclassified holder fails, and so does an inventory entry that no longer
# matches (which is what makes a fix delete its own exemption).
#
# Cheap and build-free, so it belongs in `lint`, which IS a required
# context — hazard 2 of CLAUDE.md's four is the step people forget, so
# this gate is placed where that step does not exist.
- name: Runtime GC-pointer holder custody audit
if: ${{ !cancelled() }}
run: |
python3 scripts/gc_runtime_root_holders.py --self-test
python3 scripts/gc_runtime_root_holders.py
# #7341 layer 3. A RuntimeHandleScope gives an object liveness; it does
# nothing for a raw pointer already read out of the slot. Every rooting bug
# in the quarantine sweep had rooting ALREADY -- what was missing was
# ordering the re-read against the collection point.
# `RuntimeHandle::across_{mut,const,nanbox}` expresses that ordering and
# never binds the pre-call address. This counts the sites that still don't,
# and only lets the number fall. Baseline: scripts/raw_handle_debt_baseline.txt.
- name: Raw-handle debt ratchet
if: ${{ !cancelled() }}
run: |
python3 scripts/raw_handle_debt.py --self-test
python3 scripts/raw_handle_debt.py
# The gap-suite ratchet decides whether conformance-smoke goes red, so
# its own logic is unit-checked on the cheap job rather than only being
# exercised 8 shards deep.
- name: Gap snapshot checker self-test
if: ${{ !cancelled() }}
run: python3 scripts/gap_snapshot.py --self-test
# Two halves of the same gate (#7582).
#
# `--self-test` unit-checks the checker. `--audit` runs the checker's
# OFFLINE half against the committed files: every known_failures.json
# entry must carry provenance (issue + date, #797), name a test that
# still exists, and — for gap-suite entries — be corroborated by
# `test-parity/gap_snapshot.json`, which is GENERATED and bidirectional.
# An entry absent from that snapshot is one the snapshot asserts passes,
# i.e. a suppression that has outlived its bug.
#
# This belongs on `lint` rather than only on `parity` because `parity` is
# TAG-gated: the live half of the ratchet fires after every merge it was
# meant to judge. `test_gap_diagchannel_3082_3084_3085_3086` sat here from
# 2026-07-04 and absorbed a real data-loss regression for six days (#7580);
# this step would have named it on the day it was added. Costs ~0.1s and
# runs no tests.
- name: Platform-aware parity allowlist self-test
if: ${{ !cancelled() }}
run: python3 scripts/parity_known_failures.py --self-test
- name: Parity allowlist ratchet (provenance + stale entries)
if: ${{ !cancelled() }}
run: python3 scripts/parity_known_failures.py --audit
# Moving-GC gate wiring. The GC gates are the ones this repo has most
# often found unable to fail (CLAUDE.md's four hazards), and every miss so
# far was caught by a human re-deriving it mid-incident. This asserts the
# mechanical half from `lint`, which IS a required context: each gate job
# must actually execute on main-line code (a push to `main`, or the
# nightly `schedule` — a tag-only run adjudicates nothing, it fires after
# every merge it was supposed to judge), must not carry job-level
# `continue-on-error`, must not swallow its gating step's exit status, and
# must not let a new merge cancel the previous main run.
#
# It cannot check branch protection's required-context list — that is
# server-side state, not a file in the tree — and says so; `--list` prints
# what is and is not covered.
- name: Moving-GC gate wiring
if: ${{ !cancelled() }}
run: |
python3 scripts/gc_gate_wiring_check.py --self-test
python3 scripts/gc_gate_wiring_check.py
# The other half of the same hazard (#7255). `gc_gate_wiring_check.py`
# asserts the matrix JOB can run; this asserts the matrix ARMS can fail.
# Four of the six PR-gating arms sat at copy-minor 0/50 for five weeks
# while the script's header advertised 12/22, because an all-UNVER table
# exits 0. Both checks are build-free, so they belong in `lint`:
# `--self-test` covers the red/green rule itself, `--check-registry`
# covers the known-inert list (names resolve to real arms, every entry
# cites an issue, and the matrix still calls the checker at all — a gate
# nobody invokes is the same hazard one level up).
- name: GC matrix liveness gate
if: ${{ !cancelled() }}
run: |
python3 scripts/gc_matrix_liveness_check.py --self-test
python3 scripts/gc_matrix_liveness_check.py --check-registry
# Dark-test gate. Four of this repo's suites are driven by an explicit
# registry rather than a glob, and a test file added without its registry
# line runs NOWHERE while its PR stays green — #7192, #7216, #7252 and
# #7270/#7271 all shipped that way against test-parity/gc_repsel_corpus.txt.
#
# Registration checks already existed for two of those prefixes, but both
# live behind a 90-minute compiler build, behind a changed-paths relevance
# filter, and in workflows that are NOT in branch protection — so the check
# could not run on the pull request that needed it. This is the pure
# filesystem-and-text half (~0.2s, no compiler, no Node), placed in `lint`
# BECAUSE `lint` is already a required context: hazard 2 is the step people
# forget, so this gate is put where that step does not exist.
#
# The self-test plants an unregistered file into each mechanism and asserts
# the gate names it, then removes it and asserts green — over the real
# registries, through an in-memory overlay, so the checkout is never
# mutated. Each mechanism also floors its candidate set, so a stale glob
# fails loudly instead of making every future run vacuously green.
#
# `!cancelled()` is hazard 4 in a costume nobody has named yet: `lint` is a
# SEQUENCE of independent gates, and a step that fails takes every later
# step in the job to `skipped`. That is not hypothetical here — `Public
# benchmark evidence freshness` has failed on `main` on every run from
# 2026-07-29 onward, so `File size limit`, `GC store-site inventory`,
# `Address-classification audit`, `Gap snapshot checker self-test` and
# `Platform-aware parity allowlist self-test` have all been skipped for
# days while the job dutifully reported red for an unrelated reason. A gate
# that never executes cannot fail on its own subject. This step costs 0.2s
# and shares no state with anything above it, so it always speaks.
# (`!cancelled()` rather than `always()`: a cancelled run should stay
# cancelled.) The five steps above deserve the same treatment; that is a
# separate change from this one.
- name: Test registration (dark tests)
if: ${{ !cancelled() }}
run: |
python3 scripts/check_test_registration.py --self-test
python3 scripts/check_test_registration.py
# #7672: the GC test guards CLEAR ~20 process-global side tables from
# whatever libtest thread constructs a guard, and nothing requires a
# READER to take the clearing lock. Three flakes in two days came from
# that (#7665 x2, #7671), each exposed by an unrelated PR that changed the
# parallel schedule, so the author of the exposing PR paid the diagnosis.
#
# The class is fixed by storage, not by a lock: `per_test_global!`
# gives each thread its own table in a test build. This gate derives the
# clear list from the guards' own source and fails on any bare `static`
# left behind, so a NEW sink cannot be added quietly and a new READER
# never has to remember anything. Its allowlist entries each cite an
# issue, and an entry that matches nothing fails too.
#
# Pure text, ~1s, no compiler — in `lint` because `lint` is a required
# context (hazard 2), and `!cancelled()` for the reason given above.
- name: Per-test global sinks
if: ${{ !cancelled() }}
run: |
python3 scripts/global_sink_isolation.py --self-test
python3 scripts/global_sink_isolation.py
# ---------------------------------------------------------------------------
# Clippy — enforces the deny-level lints in [workspace.lints] (root
# Cargo.toml). `cargo clippy` exits nonzero only on `deny` lints, so
# warn-level output is informational and never blocks a PR. The product leg
# gives fast feedback for the CLI; the host-compatible leg names every Linux
# package explicitly. Neither scope depends on Cargo default-members.
# ---------------------------------------------------------------------------
clippy:
name: Clippy (${{ matrix.scope }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
scope: [product, host-compatible]
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "false"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "12G"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: ./.github/actions/setup-llvm22
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.10
# Same tarball'd-disk-cache pattern as api-docs-drift (see the comment
# there for why SCCACHE_GHA_ENABLED is off).
- name: Cache sccache objects
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.sccache
key: sccache-${{ runner.os }}-perry-${{ github.job }}-${{ github.run_id }}
restore-keys: |
sccache-${{ runner.os }}-perry-
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Run clippy for explicit scope
run: |
if [[ "${{ matrix.scope }}" == "product" ]]; then
cargo clippy -p perry --bins
else
mapfile -t excluded < <(python3 scripts/workspace_architecture.py \
--print-excluded-scope host-compatible)
cargo_args=(--workspace)
for package in "${excluded[@]}"; do
cargo_args+=(--exclude "$package")
done
cargo clippy "${cargo_args[@]}"
fi
# ---------------------------------------------------------------------------
# rustc warnings gate
#
# `cargo check` with `-D warnings`, so a PR cannot add a rustc warning. This
# is deliberately separate from the clippy job above: clippy's own warn-level
# lints are informational here, while rustc's are not.
#
# Both legs are needed because they compile different code. `perry` depends on
# perry-runtime with `default-features = false`, so the product leg sees a
# runtime with regex-engine, diagnostics and temporal off, where items the
# workspace leg finds live are dead. The workspace leg passes `--all-targets`
# so test and bench targets count too — without it, test-only code drifts.
#
# perry-ui-macos is in the excluded scope (this runs on ubuntu), so its
# warnings are not gated here.
# ---------------------------------------------------------------------------
rustc-warnings:
name: Warnings (${{ matrix.scope }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
scope: [product, host-compatible]
env:
RUSTFLAGS: -D warnings
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "false"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "12G"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-llvm22
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.10
- name: Cache sccache objects
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.sccache
key: sccache-${{ runner.os }}-perry-${{ github.job }}-${{ github.run_id }}
restore-keys: |
sccache-${{ runner.os }}-perry-
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check for rustc warnings
run: |
if [[ "${{ matrix.scope }}" == "product" ]]; then
cargo check -p perry --bins
else
mapfile -t excluded < <(python3 scripts/workspace_architecture.py \
--print-excluded-scope host-compatible)
cargo_args=(--workspace --all-targets)
for package in "${excluded[@]}"; do
cargo_args+=(--exclude "$package")
done
cargo check "${cargo_args[@]}"
fi
# ---------------------------------------------------------------------------
# API docs drift gate (#465)
#
# Regenerates `docs/src/api/reference.md` and `docs/api/perry.d.ts` from
# the compile-time manifest in `crates/perry-api-manifest/src/entries.rs`,
# then `git diff --exit-code`s the result. Fails when a code change updated
# the manifest without re-committing the artifacts. Closes the "Release
# workflow regenerates docs automatically (no drift from code)" criterion
# — committing the diff is the easiest way to keep the docs in sync,
# since the diff is reviewable in the PR that introduces it.
# ---------------------------------------------------------------------------
api-docs-drift:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
RUSTC_WRAPPER: sccache
# sccache on a LOCAL DISK cache, persisted as a single tarball via
# actions/cache (see the "Cache sccache objects" step) — NOT the GitHub
# Actions cache backend (SCCACHE_GHA_ENABLED). The GHA backend stores one
# cache object per compilation unit; GitHub's cache service throttled /
# LRU-evicted the thousands of tiny entries, so a full build wrote ~3.3k
# objects (≈35 min of write time) yet the next run got ~0% Rust hits
# (measured: 3 hits / 3209 misses, 613 write errors) — i.e. every run
# recompiled the dependency graph cold. A single tarball'd disk cache
# restores in one step and gives real cross-run hit rates. Note
# SCCACHE_CACHE_SIZE is honoured by the disk backend (it was a silent
# no-op under the GHA backend, which is why the old "2G" never mattered).
SCCACHE_GHA_ENABLED: "false"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "12G"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-llvm22
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.10
# Persist the sccache disk cache across runs. The github.job +
# github.run_id key makes every run (including PRs) save its own fresh
# entry — distinct per job so the three sccache jobs don't collide on
# save — while the shared prefix restore-keys pull the most recent prior
# cache from ANY of them. The object cache therefore warms continuously
# and cross-pollinates instead of starting cold each run.
- name: Cache sccache objects
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.sccache
key: sccache-${{ runner.os }}-perry-${{ github.job }}-${{ github.run_id }}
restore-keys: |
sccache-${{ runner.os }}-perry-
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Regenerate API docs
run: ./scripts/regen_api_docs.sh
- name: Check for drift
run: |
if ! git diff --quiet -- docs/src/api/reference.md docs/api/perry.d.ts; then
echo ""
echo "::error::API docs drift detected. The compile-time manifest in"
echo "::error::crates/perry-api-manifest/src/entries.rs changed but the"
echo "::error::generated artifacts under docs/ weren't regenerated."
echo ""
echo "Fix by running:"
echo " ./scripts/regen_api_docs.sh"
echo " git add docs/src/api/reference.md docs/api/perry.d.ts"
echo " git commit -m 'docs: regenerate API reference + .d.ts'"
echo ""
echo "Diff:"
git --no-pager diff --stat -- docs/src/api/reference.md docs/api/perry.d.ts
echo ""
git --no-pager diff -- docs/src/api/reference.md docs/api/perry.d.ts | head -200
exit 1
fi
echo "✅ API docs match the manifest."
# ---------------------------------------------------------------------------
# Rust unit tests (266+ tests across all crates)
# ---------------------------------------------------------------------------
# Note: a separate `build` job that produced runtime/stdlib/compiler
# artifacts USED to live here. It only fed `binary-size` (which now does
# its own quick build) — every other job did `cargo build --release`
# itself anyway, so `needs: build` was a serializing barrier with no
# cache benefit. Removed in v0.5.387 along with the `actions/cache@v4`
# blocks (replaced by `Swatinem/rust-cache@v2`, which handles target/
# pruning intelligently and avoids the disk-pressure issue that
# required the manual simulator-runtime wipe + cache=registry-only
# workaround). Each downstream job below builds in parallel directly.
cargo-test:
# Was macos-14 — moved to ubuntu-latest in v0.5.392 to drop the 10×
# billing weight. The centralized Linux test scope already filters out
# platform-specific UI crates, so
# the platform-independent test set runs identically on Linux. The
# macOS-host coverage we lose here is negligible — these tests
# don't exercise any platform behavior; they're pure logic +
# codegen.
runs-on: ubuntu-latest
# The per-package serial build+prune loop below (plus the big stdlib links)
# takes ~50-60 min with a WARM sccache disk cache. A fully cold cache
# (recompiling the whole dependency graph) measured ~90-103 min, and PRs
# that invalidate perry-runtime/perry-codegen previously exceeded the old
# 120-min bound entirely. The bound is 180 to (a) leave headroom while the
# disk cache warms after the sccache-backend fix, and (b) still cut a true
# hang (e.g. a flaky link SIGBUS retry storm). Once warm hit rates are
# confirmed in CI this can come back down. NOTE: the old "~45-50 min" figure
# predated the sccache GHA-backend rot — it was never accurate once that
# cache stopped delivering Rust hits.
timeout-minutes: 180
# sccache (compiler-level cache, shared across ALL branches/jobs via the
# GitHub Actions cache backend) on top of Swatinem/rust-cache (target/ +
# registry). rust-cache only writes on main (save-if below), so PRs can't
# warm it — and any change to the constantly-churning perry-runtime
# invalidates the whole downstream target/, whereas sccache still reuses
# the unchanged compilation units. CARGO_INCREMENTAL=0 is required: sccache
# cannot cache incremental builds. SCCACHE_CACHE_SIZE bounds the on-runner
# cache so it doesn't compound this job's known disk pressure (the prune
# loop below).
env:
RUSTC_WRAPPER: sccache
# sccache on a LOCAL DISK cache, persisted as a single tarball via
# actions/cache (see the "Cache sccache objects" step) — NOT the GitHub
# Actions cache backend (SCCACHE_GHA_ENABLED). The GHA backend stores one
# cache object per compilation unit; GitHub's cache service throttled /
# LRU-evicted the thousands of tiny entries, so a full build wrote ~3.3k
# objects (≈35 min of write time) yet the next run got ~0% Rust hits
# (measured: 3 hits / 3209 misses, 613 write errors) — i.e. every run
# recompiled the dependency graph cold. A single tarball'd disk cache
# restores in one step and gives real cross-run hit rates. Note
# SCCACHE_CACHE_SIZE is honoured by the disk backend (it was a silent
# no-op under the GHA backend, which is why the old "2G" never mattered).
SCCACHE_GHA_ENABLED: "false"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "12G"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-llvm22
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.10
# Persist the sccache disk cache across runs. The github.job +
# github.run_id key makes every run (including PRs) save its own fresh
# entry — distinct per job so the three sccache jobs don't collide on
# save — while the shared prefix restore-keys pull the most recent prior
# cache from ANY of them. The object cache therefore warms continuously
# and cross-pollinates instead of starting cold each run.
- name: Cache sccache objects
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.sccache
key: sccache-${{ runner.os }}-perry-${{ github.job }}-${{ github.run_id }}
restore-keys: |
sccache-${{ runner.os }}-perry-
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
save-if: ${{ github.ref == 'refs/heads/main' }}
# #5892 — the auto-opt archive cache (target/perry-auto-<hash>) keys on
# perry-runtime's source hash and does NOT account for ext-crate sources,
# so a rust-cache-restored stale dir keeps linking OUTDATED ext archives
# into test-compiled binaries even after the ext sources were fixed (this
# is how the #5911 shim fix failed to clear the issue_4903 hang: the
# restored cache still carried pre-fix optimized archives). Evict it so
# every run links archives built from the checked-out tree; costs one
# ~6-9 min rebuild on the first perry compile of the run.
- name: Evict stale auto-opt archives (#5892)
run: |
rm -rf target/perry-auto-* target/debug/libperry_ext_*.a 2>/dev/null || true
- name: Run cargo test
# The exclusions below are maintained once in
# workspace-architecture.json and consumed by ci_test_scope.py:
# - perry-ui-macos / perry-ui-ios / perry-ui-tvos / perry-ui-watchos
# / perry-ui-visionos: depend on `objc2` which only compiles on
# Apple platforms (`compile_error!` in objc2/src/lib.rs:219).
# - perry-ui-gtk4: needs system pango/gtk via pkg-config; runner
# image doesn't have libgtk-4-dev installed by default.
# - perry-ui-android: needs Android NDK.
# - perry-ui-windows: needs win32 headers.
# - perry-ui-windows-winui: re-exports perry-ui-windows, so it inherits
# the same win32 / webview2-com dependency that won't build on Linux.
env:
# Rust's Ubuntu target can drive `cc` with `-fuse-ld=lld`; on the
# shared runner this has repeatedly terminated large test links with
# SIGBUS. Use the system linker for the cargo-test gate.
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C linker-features=-lld"
# Keep test artifacts small enough for the shared runner disk. The
# cargo-test job does not need line tables, and debug info was enough
# to make later package archives hit ENOSPC after several package
# test builds accumulated in target/debug.
CARGO_PROFILE_TEST_DEBUG: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
# For `gh pr view` (PR changed-file list → affected-crate scope).
GH_TOKEN: ${{ github.token }}
run: |
(
while sleep 60; do
echo "cargo-test still running at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
done
) &
cargo_test_heartbeat_pid=$!
trap 'kill "$cargo_test_heartbeat_pid" 2>/dev/null || true' EXIT
# Test scope: a per-PR run only exercises the crates the diff can
# affect (changed crates + their reverse-dependency closure, plus a
# `perry` edge for runtime-linked stdlib/ext archives) instead of the
# whole workspace (~90 min). Release tags, the nightly cron, and
# workflow_dispatch run the FULL workspace as the safety net. See
# scripts/ci_test_scope.py for the rules.
if [ "${{ github.event_name }}" = "pull_request" ]; then
changed_files="$(gh pr view "${{ github.event.pull_request.number }}" \
--json files --jq '.files[].path')"
echo "Changed files in PR:"; printf '%s\n' "$changed_files"
scope="$(printf '%s\n' "$changed_files" | python3 scripts/ci_test_scope.py)"
else
scope="$(python3 scripts/ci_test_scope.py --full </dev/null)"
fi
echo "Packages in test scope:"; printf '%s\n' "$scope"
if [ -z "$scope" ]; then
echo "No crates affected by this diff — nothing to test."
exit 0
fi
# #1444: perry-runtime's tests share process-global state — the
# per-thread arena/GC, the timer queues, and the `NOTIFIED` flag are
# process singletons. Running them across the default test-harness
# thread pool lets one test's `js_notify_main_thread` / timer
# scheduling perturb another's wait budget (the event_pump timing
# flakes) and races the GC/threading tests into intermittent SIGSEGV.
# Run perry-runtime single-threaded so the tests can't interfere.
if [ "${{ github.event_name }}" != "pull_request" ]; then
# ---- FULL run: release tags / nightly cron / workflow_dispatch ----
# Every target, including the slow auto-optimize integration tests.
if printf '%s\n' "$scope" | grep -qx 'perry-runtime'; then
RUST_TEST_THREADS=1 cargo test -p perry-runtime
fi
# `cargo test` only builds lib/bin/test targets — NOT the `staticlib`
# crate-type — so libperry_runtime.a / libperry_stdlib.a are never
# produced by the steps above; they only exist if restored from the
# cache. Integration tests that compile with PERRY_NO_AUTO_OPTIMIZE=1
# (e.g. functional_batch2_regressions) link the prebuilt archive
# directly and fail with "Could not find libperry_runtime.a" if the
# cached staticlib was invalidated. Build them explicitly.
if printf '%s\n' "$scope" | grep -qE '^(perry|perry-stdlib)$'; then
cargo build -p perry-runtime -p perry-stdlib -p perry-runtime-static -p perry-stdlib-static
fi
find target/debug/deps -maxdepth 1 -type f -perm -111 ! -name '*.so' -delete
# Large perry / perry-stdlib integration-test binaries: serialize
# builds and prune linked executables between packages so the runner
# disk doesn't exhaust mid-job.
export CARGO_BUILD_JOBS=1
for package in $(printf '%s\n' "$scope" | grep -vx 'perry-runtime'); do
echo "::group::cargo test -p $package"
cargo test -p "$package"
echo "::endgroup::"
cargo clean -p "$package" || true
find target/debug/deps -maxdepth 1 -type f -perm -111 ! -name '*.so' -delete
done
else
# ---- FAST per-PR run (<10 min target) ----
# Unit / lib / bin tests for the affected crates only. The slow
# auto-optimize *integration* tests (tests/*.rs — each shells out to
# `perry compile`, ~4–6 min apiece, 163 of them in crates/perry
# alone) are NOT run wholesale per-PR; they run in the nightly full
# job, on release tags, and on demand via the `run-extended-tests`
# label. No staticlib dependency to build here (no integration
# tests).
#
# #5960: the suites the DIFF NAMES — i.e. a PR's own new/edited
# acceptance suite — do run per-PR, in the separate `e2e-scoped`
# job below. Without it a PR's acceptance test could not fail its
# own CI (#5938).
#
# Run each crate in its OWN `cargo test` invocation — NOT one
# multi-package invocation. Building several crates together unifies
# perry-runtime's cargo features, which turns on optional impls (e.g.
# `fetch`) whose extern symbols (`js_fetch_with_options`) live in a
# separate crate the other test binaries don't link → `undefined
# reference` at link. Per-package builds keep each crate's
# perry-runtime feature set isolated. CARGO_BUILD_JOBS=1 also bounds
# the heavy per-binary runtime link so the runner doesn't OOM.
# `--with-tests` drops crates whose `src/` has no unit tests (their
# lib test binary would link the runtime for zero tests).
export CARGO_BUILD_JOBS=1
# perry-runtime first, single-threaded (process-global state); it is
# a lib-only crate, so filter to --lib.
if printf '%s\n' "$scope" | grep -qx 'perry-runtime'; then
RUST_TEST_THREADS=1 cargo test --lib -p perry-runtime
fi
rest="$(printf '%s\n' "$scope" | grep -vx 'perry-runtime' \
| python3 scripts/ci_test_scope.py --with-tests || true)"
echo "Crates with unit tests in scope:"; printf '%s\n' "$rest"
for package in $rest; do
# `cargo test --lib` errors on a bin-only crate (perry), so pick
# the target filter per package: --lib --bins when it has a lib
# (lenient if it has no bins), else --bins.
if printf '%s\n' "$package" | python3 scripts/ci_test_scope.py --has-lib; then
target_filter="--lib --bins"
else
target_filter="--bins"
fi
echo "::group::cargo test $target_filter -p $package"
cargo test $target_filter -p "$package"
echo "::endgroup::"
done
fi
# ---------------------------------------------------------------------------
# Scoped e2e: run the integration suites NAMED BY THE DIFF (#5960)
#
# The per-PR `cargo-test` gate is `--lib --bins` only, so *no* `tests/*.rs`
# integration suite runs on a PR — including the PR's own. That is how #5938
# landed with its acceptance suite (`capture_rereg_renamed_class.rs`) red
# through green required checks: the suite was in the diff, was compiled into
# the scope listing, and was never executed. Running every suite per-PR is not
# an option (163 in `crates/perry` alone, each shelling out to `perry
# compile`), so this tier runs exactly the ones the diff names:
#
# changed `crates/<pkg>/tests/<suite>.rs` -> cargo test -p <pkg> --test <suite>
#
# (plus suite module dirs and `common/` helper dirs — see
# scripts/ci_e2e_scope.py, capped at 12 suites).
#
# Cost: PRs that touch no integration suite — the large majority — finish in
# ~20-30s of checkout + scope computation and never install a toolchain or
# build anything (the scope step parses Cargo.toml directly, no `cargo
# metadata`). Only a PR that adds or edits a suite pays the build, and it pays
# it in PARALLEL with `cargo-test`, which is the longer pole anyway.
#
# NOT covered: a source change that regresses an *existing* suite the diff
# doesn't name (#6037 class). There is no coverage data to map that with, and
# a crate-level map (perry-codegen -> all of perry's suites) is precisely the
# full run we're avoiding. The nightly full `cargo test` remains the backstop
# for that class — hence the concurrency carve-out above.
# ---------------------------------------------------------------------------
e2e-scoped:
# PR-only: tags / nightly / workflow_dispatch already run every suite in the
# full `cargo-test` path.
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
# MUST cover the worst case the per-suite bound allows, or the job wall
# clock kills legitimately-running suites and we get an uninformative
# "cancelled" instead of the per-suite `::error::` — reintroducing, one
# level up, exactly what `timeout 1500` below exists to prevent.
# DEFAULT_CAP (ci_e2e_scope.py) = 12 suites
# per-suite bound below = timeout 1500s = 25 min
# 12 x 25 = 300, + 30 min for toolchain/cache/staticlib build = 330
# Keep these three in sync. This is a backstop, not a budget: each suite is
# independently bounded, and the common case selects zero suites and exits
# in ~20-30s.
timeout-minutes: 330
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "false"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "12G"
CARGO_INCREMENTAL: "0"
steps:
# Nothing here pushes back to the repo, and the job compiles third-party
# crates (build scripts run), so don't leave a git credential on disk.
- uses: actions/checkout@v7
with:
persist-credentials: false
# Cheap gate: no toolchain, no cargo, no cache restore. Every step below
# is skipped when the diff names no suite.
- name: Compute e2e suite scope
id: scope
env:
GH_TOKEN: ${{ github.token }}
run: |
python3 scripts/ci_e2e_scope.py --self-test
changed_files="$(gh pr view "${{ github.event.pull_request.number }}" \
--json files --jq '.files[].path')"
suites="$(printf '%s\n' "$changed_files" | python3 scripts/ci_e2e_scope.py)"
if [ -z "$suites" ]; then
echo "No integration suite named by this diff — nothing to run."
echo "suites=" >> "$GITHUB_OUTPUT"
else
echo "Integration suites in scope:"
printf '%s\n' "$suites"
{
echo 'suites<<PERRY_EOF'
printf '%s\n' "$suites"
echo 'PERRY_EOF'
} >> "$GITHUB_OUTPUT"
fi
- name: Install Rust toolchain
if: steps.scope.outputs.suites != ''
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-llvm22
- name: Install sccache
if: steps.scope.outputs.suites != ''
uses: mozilla-actions/sccache-action@v0.0.10
- name: Cache sccache objects
if: steps.scope.outputs.suites != ''
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.sccache
key: sccache-${{ runner.os }}-perry-${{ github.job }}-${{ github.run_id }}
restore-keys: |
sccache-${{ runner.os }}-perry-
- uses: Swatinem/rust-cache@v2
if: steps.scope.outputs.suites != ''
with:
shared-key: "${{ runner.os }}-perry"
save-if: ${{ github.ref == 'refs/heads/main' }}
# Same reasoning as cargo-test: a rust-cache-restored auto-opt archive dir
# keys only on perry-runtime's source hash and would link stale ext
# archives into the binaries these suites compile (#5892).
- name: Evict stale auto-opt archives (#5892)
if: steps.scope.outputs.suites != ''
run: rm -rf target/perry-auto-* target/debug/libperry_ext_*.a 2>/dev/null || true
- name: Run scoped integration suites
if: steps.scope.outputs.suites != ''
env:
# lld has repeatedly SIGBUS'd large test links on the shared runner.
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C linker-features=-lld"
CARGO_PROFILE_TEST_DEBUG: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
# Bound the heavy per-binary runtime link so the runner doesn't OOM.
CARGO_BUILD_JOBS: "1"
SUITES: ${{ steps.scope.outputs.suites }}
run: |
# `cargo test` never builds the `staticlib` crate-type, so
# libperry_{runtime,stdlib}.a don't exist unless built explicitly —
# and the suites that compile with PERRY_NO_AUTO_OPTIMIZE=1 link them
# directly ("Could not find libperry_runtime.a" otherwise).
if printf '%s\n' "$SUITES" | grep -qE '^(perry|perry-stdlib) '; then
cargo build -p perry-runtime -p perry-stdlib \
-p perry-runtime-static -p perry-stdlib-static
fi
status=0
while read -r package suite; do
[ -n "$package" ] || continue
echo "::group::cargo test -p $package --test $suite"
# Per-suite wall-clock bound: a hung compile must not eat the whole
# job budget and hide the other suites' results.
if ! timeout 1500 cargo test -p "$package" --test "$suite"; then
echo "::error::integration suite failed: $package --test $suite"
status=1
fi
echo "::endgroup::"
done <<< "$SUITES"
exit "$status"
# ---------------------------------------------------------------------------
# Windows build gate
#
# Exists because Windows-only compile/link breaks previously shipped to main
# unseen — every other job runs on ubuntu/macos. Two real examples that
# landed through green required checks: an MSVC-only rustc error (E0308 on
# the `ExitProcess` extern in crates/perry-runtime/src/process/env_misc.rs)
# and an MSVC-only link error (LNK2019: `js_crypto_ed25519_verify`
# unresolved when linking perry.exe — Unix linkers dead-strip the unused
# extern, link.exe errors). Building `perry` LINKS perry.exe, so the LNK2019
# class is caught here, not just rustc errors. The perry-dev profile
# (opt-level 1, no LTO) keeps a cold Windows build inside a PR-sized budget;
# --release would be far too slow for per-PR CI.
# ---------------------------------------------------------------------------
windows-build:
runs-on: windows-latest
# Cold Windows builds are slow, and this workflow never runs on pushes to
# main, so rust-cache only saves on the nightly cron (github.ref is
# refs/heads/main for `schedule`) — PR runs after a quiet night can be
# near-cold. 75 leaves headroom over a fully cold build while still
# bounding a true hang (same reasoning as conformance-smoke's bump: a
# timeout on a required-path job is a deterministic PR blocker).
timeout-minutes: 75
steps:
- uses: actions/checkout@v7
with:
# This job compiles PR-controlled build scripts / proc macros;
# don't leave the workflow token in .git/config for them to read
# (zizmor "artipacked", flagged by review on #6610).