Skip to content

Commit 3a489b4

Browse files
committed
ci: run the examples without the runner node wrapper in every mode
The existing jobs reach node through PATH, so the runner wrapper always injects the V8 flags and the plugin's restart never runs. Launch node by absolute path, as Bazel's rules_js does, in simulation, walltime and memory mode, and fail when the plugin reports missing flags or a failed restart. Refs COD-4038
1 parent 8ef4d2e commit 3a489b4

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,46 @@ jobs:
121121
env:
122122
CODSPEED_SKIP_UPLOAD: true
123123
CODSPEED_DEBUG: true
124+
125+
# Bazel's rules_js runs node by absolute path, so the runner's `node` wrapper
126+
# on PATH never injects the V8 flags and the plugin must restart itself.
127+
restart-without-node-wrapper:
128+
runs-on: "ubuntu-latest"
129+
name: "restart without node wrapper (${{ matrix.mode }})"
130+
strategy:
131+
matrix:
132+
mode: [simulation, walltime, memory]
133+
fail-fast: false
134+
steps:
135+
- uses: "actions/checkout@v4"
136+
with:
137+
fetch-depth: 0
138+
submodules: true
139+
- uses: pnpm/action-setup@v4
140+
- uses: actions/setup-node@v6
141+
with:
142+
cache: pnpm
143+
node-version: 24
144+
- name: Restore turbo cache
145+
uses: ./.github/actions/turbo-cache
146+
with:
147+
key-suffix: node24
148+
- run: pnpm install --frozen-lockfile --prefer-offline
149+
- run: pnpm turbo run build
150+
# Resolved before the action prefixes PATH with its wrapper.
151+
- run: echo "REAL_NODE=$(command -v node)" >> "$GITHUB_ENV"
152+
- uses: CodSpeedHQ/action@main
153+
with:
154+
mode: ${{ matrix.mode }}
155+
working-directory: examples/with-javascript-esm
156+
run: |
157+
set -o pipefail
158+
"$REAL_NODE" tinybench.js 2>&1 | tee tinybench.log
159+
"$REAL_NODE" benchmark-js.js 2>&1 | tee benchmark-js.log
160+
env:
161+
CODSPEED_SKIP_UPLOAD: true
162+
CODSPEED_DEBUG: true
163+
- name: Check the benchmarks ran with the V8 flags
164+
working-directory: examples/with-javascript-esm
165+
run: |
166+
! grep -E "missing required flags|failed to restart node" tinybench.log benchmark-js.log

0 commit comments

Comments
 (0)