mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
- ci.yml runs test (plain|san, 1..3/3) on macos-15; an aggregate job keeps the old "test" check name for anything pinned to it - each job runs vitest twice: --shard=i/3 over everything but the corpus lanes, then the four corpus lanes with only their case slice — a file lands in exactly one --shard slice, so mixing the axes would silently drop cases - tests/harness/shard.ts: SCRIPTC_TEST_SHARD="i/n" slices case lists by sha1(name) mod n — stable across corpus growth, every case in exactly one shard, unset means everything - differential, llvm-differential, npm, and server harnesses slice through it; the llvm tier-floor assertion checks only this shard's floor programs - shard.test.ts pins the partition contract (union exact, disjoint, key-stable, env-driven default) and stays green with the job-wide env set
74 lines
2.8 KiB
YAML
74 lines
2.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
tests:
|
|
name: test (${{ matrix.flavor }}, ${{ matrix.shard }}/3)
|
|
# arm64 macOS: same clang/libc the differential + number-formatting
|
|
# oracles were verified against.
|
|
runs-on: macos-15
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flavor: [plain, san]
|
|
shard: [1, 2, 3]
|
|
env:
|
|
# Capped workers: the shared runner's cores oversubscribe under the
|
|
# corpus compile fan-out, and vitest's worker RPC times out ("Timeout
|
|
# calling onTaskUpdate") with every test green — the same contention
|
|
# artifact the harness README documents for local parallel suites.
|
|
SCRIPTC_TEST_WORKERS: "4"
|
|
# san = ASan + RC audit over the same suite; anything but "1" is plain.
|
|
SCRIPTC_SAN: ${{ matrix.flavor == 'san' && '1' || '' }}
|
|
# Within-file partition for the corpus-driven harnesses (differential,
|
|
# llvm-differential, npm, server): they hash stable case names into
|
|
# slice i of 3 (tests/harness/shard.ts), so the three shards' unions
|
|
# run every case exactly once. vitest's own --shard is FILE-granular
|
|
# and cannot split these monster files (differential.test.ts alone is
|
|
# ~9 min sequential), hence the second test step below.
|
|
SCRIPTC_TEST_SHARD: ${{ matrix.shard }}/3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 11
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm build
|
|
# Two vitest invocations because the shard axes must not mix: a file
|
|
# lands in exactly ONE --shard slice, so an env-sharded file behind
|
|
# --shard would run only one of its three case slices and silently
|
|
# drop the rest. Files split by --shard here; cases split by env below.
|
|
- name: Tests (file-sharded, corpus lanes excluded)
|
|
run: >-
|
|
pnpm test --shard=${{ matrix.shard }}/3
|
|
--exclude=tests/harness/differential.test.ts
|
|
--exclude=tests/harness/llvm-differential.test.ts
|
|
--exclude=tests/harness/npm.test.ts
|
|
--exclude=tests/harness/server.test.ts
|
|
- name: Tests (corpus lanes, case slice ${{ matrix.shard }}/3)
|
|
run: >-
|
|
pnpm test
|
|
tests/harness/differential.test.ts
|
|
tests/harness/llvm-differential.test.ts
|
|
tests/harness/npm.test.ts
|
|
tests/harness/server.test.ts
|
|
|
|
# Aggregate gate with the pre-matrix job's name, so anything keyed on the
|
|
# single "test" check (branch protection, badges) keeps resolving. Fails
|
|
# unless every matrix shard succeeded.
|
|
test:
|
|
needs: tests
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: All shards green
|
|
run: test "${{ needs.tests.result }}" = success
|