diff --git a/.github/workflows/testbox.yml b/.github/workflows/testbox.yml index d18c0028a..6c5bd3a12 100644 --- a/.github/workflows/testbox.yml +++ b/.github/workflows/testbox.yml @@ -2,7 +2,7 @@ # (scripts/goport/testbox.sh). `blacksmith testbox warmup` dispatches this workflow, `testbox run` syncs # the working tree to it and runs one command. The setup matches the Linux test job of ci.yml, with # zbook's toolchains. Sticky disks keep target/ and the cargo registry warm between testboxes. -# A pull request that changes this file runs it in validation mode (no testbox_id). +# A pull request that changes this file, testbox-data.sh or testbox-data.txt runs it in validation mode (no testbox_id). name: Blacksmith Testbox on: @@ -15,6 +15,8 @@ on: pull_request: paths: - ".github/workflows/testbox.yml" + - "scripts/goport/testbox-data.sh" + - "scripts/goport/testbox-data.txt" permissions: contents: read @@ -42,7 +44,10 @@ jobs: - uses: actions/checkout@v5 with: persist-credentials: false - # After checkout: its clean step would empty a disk mounted in the workspace. + # After checkout: its clean step would empty a disk mounted in the workspace. A sticky disk commits only + # when the job ends with no failed or cancelled step: the idle timeout end requests a commit (testbox.sh + # release; not every request lands, see scripts/goport/README.md), `blacksmith testbox stop` cancels the + # job and does not (testbox.sh stop). - uses: useblacksmith/stickydisk@v1 with: key: ts-rust-testbox-target @@ -51,6 +56,10 @@ jobs: with: key: ts-rust-testbox-cargo path: ~/.cargo/registry + # np-suite needs Node 22 or newer; npm ci below needs node. + - uses: actions/setup-node@v5 + with: + node-version: 24 # main's Go pin is the saved state's batch.upstreamPin.to (AGENTS.md, "Pin"). The Go checkout sits # outside the workspace, so a sync of the local tree does not touch it. - name: Resolve the Go pin @@ -71,19 +80,17 @@ jobs: key: ts-rust-testbox-pin-${{ steps.pin.outputs.key }} path: ~/goport-data/pin commit: on-change + # The whole repo, not only the Go subdir: np-suite reads packages/typescript and the root node_modules. - name: Check out the pinned Go source uses: actions/checkout@v5 with: repository: ${{ steps.pin.outputs.repo }} ref: ${{ steps.pin.outputs.commit }} path: go-pin - sparse-checkout: ${{ steps.pin.outputs.subdir }} persist-credentials: false - - name: Install the Go repo's typescript package + - name: Install the Go repo's node_modules run: | - url=$(jq -r '.packages["node_modules/typescript"].resolved' go-pin/package-lock.json) - mkdir -p go-pin/node_modules/typescript - curl -sSfL "$url" | tar xz -C go-pin/node_modules/typescript --strip-components=1 + (cd go-pin && npm ci --ignore-scripts --no-audit --no-fund --loglevel=error) mv go-pin "$HOME/go-pin" - uses: actions/setup-go@v6 with: @@ -109,7 +116,7 @@ jobs: SUBDIR: ${{ steps.pin.outputs.subdir }} run: | cat > "$HOME/testbox.env" < for a workflow change +scripts/goport/testbox.sh tests # build-goport-tests.sh, goport-tests.sh, compare-tests.py +scripts/goport/testbox.sh np-suite