Skip to content

Commit cd7d4fb

Browse files
claudewan9chi
authored andcommitted
ci: test warm Linux Windows archive build
Cross-compile Windows test binaries on Linux with the xwin SDK cache restored, then run the archived tests across four Windows partitions. Run the smaller ignored suite once on the last partition to test whether extra run-only shards improve wall time.
1 parent 6145cfe commit cd7d4fb

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,12 @@ jobs:
133133

134134
# Windows tests are cross-compiled on a fast Linux runner with cargo-xwin
135135
# (clang-cl + lld-link against the xwin-downloaded MSVC CRT/Windows SDK)
136-
# and packed into a portable nextest archive. The test-windows shards then
137-
# only download the archive and run it — no Rust toolchain or compilation
138-
# on the slow Windows runners. Windows e2e fixtures dominate wall-clock
139-
# (60s per PTY step vs 20s on Unix), so the run is split across shards via
140-
# nextest's count partitioning, which spreads tests round-robin.
136+
# and packed into a portable nextest archive. The Windows runners then only
137+
# download the archive and run it: no Rust toolchain or compilation on the
138+
# slow runners. Four nextest partitions avoid most repeated setup while keeping
139+
# enough parallelism for the Windows-heavy default test workload. The much
140+
# smaller Node-backed ignored suite runs once in the last partition, avoiding
141+
# a duplicate Windows Node setup.
141142
build-windows-tests:
142143
needs: detect-changes
143144
if: needs.detect-changes.outputs.code-changed == 'true'
@@ -174,7 +175,7 @@ jobs:
174175
tool: cargo-nextest,cargo-xwin
175176

176177
# Downloading and unpacking the MSVC CRT/Windows SDK dominates this
177-
# job's wall time (~10 minutes); the unpacked result is immutable for a
178+
# job's wall time on a cold cache; the unpacked result is immutable for a
178179
# given manifest version, so cache it. Bump the key when bumping the
179180
# xwin version.
180181
- uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
@@ -214,10 +215,10 @@ jobs:
214215
strategy:
215216
fail-fast: false
216217
matrix:
217-
partition: [1, 2, 3, 4, 5, 6]
218+
partition: [1, 2, 3, 4]
218219
runs-on: windows-latest
219220
env:
220-
PARTITION: count:${{ matrix.partition }}/6
221+
PARTITION: count:${{ matrix.partition }}/4
221222
steps:
222223
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
223224

@@ -243,11 +244,11 @@ jobs:
243244
run: cargo-nextest nextest run --archive-file windows-tests.tar.zst --workspace-remap . --partition "$PARTITION"
244245

245246
- uses: oxc-project/setup-node@ab97f03642370d79a7e96dd286bd02a1be40e0ba # v1.3.0
247+
if: matrix.partition == 4
246248

247-
# --no-tests=pass: a shard's partition of the (much smaller) ignored
248-
# test set may legitimately come up empty.
249249
- name: Run ignored tests
250-
run: cargo-nextest nextest run --archive-file windows-tests.tar.zst --workspace-remap . --partition "$PARTITION" --run-ignored ignored-only --no-tests pass
250+
if: matrix.partition == 4
251+
run: cargo-nextest nextest run --archive-file windows-tests.tar.zst --workspace-remap . --run-ignored ignored-only
251252

252253
test-musl:
253254
needs: detect-changes

crates/fspy/tests/oxlint.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ use test_log::test;
88
/// Get the packages/tools/.bin directory path
99
fn tools_bin_dir() -> std::path::PathBuf {
1010
// Resolve CARGO_MANIFEST_DIR at run time, not via `env!`: a compile-time
11-
// path bakes in the build machine's checkout, which breaks when the test
12-
// binary is cross-compiled and run on another machine (e.g. built on
13-
// Linux with cargo-xwin, run on Windows from a nextest archive).
11+
// path can point at a different checkout than the one executing the test.
1412
let manifest_dir = std::path::PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap());
1513
manifest_dir
1614
.parent()

0 commit comments

Comments
 (0)