A gate that stands in front of the suite delays the news it carries, so it runs beside it (#94)
The workflow ran everything in one job: check.sh, then build, then the e2e suite and the smokes. The runner has two job slots and four cores, so the second slot lay idle for the whole run, and a lint error was reported only after the full suite had passed in front of it - six minutes instead of one. Now `gate` and `suite` are two jobs without `needs:`. They start together, both have to pass. The price is contention: while the gate runs, vitest and chromium share four cores, and the suite measures text widths and frame counts, which a loaded machine reports differently. The gate therefore caps vitest at two workers via GM_TEST_WORKERS, so two cores stay free for the browser over the whole overlap. Locally the variable is unset and nothing changes. Measured before the push: the cap costs vitest 4.4s (16.6s -> 21.0s), check.sh exits 0 with it, build ok. Whether the split is worth it is a question for the runner - the expected net gain is about 50s, and the acceptance is a measurement over at least two runs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
36ccc7626f
commit
15bdfdf07a
2 files changed
+27
-3
No files matched your search
+23
-3
@@ -3,6 +3,15 @@
|
||||
# `runs-on: game-maker-ci` picks the image built from tools/ci/Dockerfile. The render device and
|
||||
# /dev/shm come from the runner's own container.options (/_stacks/git/runner/config.yaml), not
|
||||
# from here – without them chromium falls back to software WebGL.
|
||||
#
|
||||
# Two jobs without `needs:`, so they start together and use both slots of the runner
|
||||
# (`capacity: 2`, four cores). The gate no longer stands in front of the suite: a lint error used
|
||||
# to cost the full e2e run before it was reported, and the run reported it after six minutes
|
||||
# instead of one. Both still have to pass for the push to be green.
|
||||
#
|
||||
# The price is contention: while the gate runs, vitest and chromium share the four cores, and the
|
||||
# suite measures text widths and frame counts. That is why the gate caps vitest at two workers
|
||||
# (GM_TEST_WORKERS) – two cores stay free for the browser for the whole overlap.
|
||||
name: game-maker
|
||||
|
||||
on:
|
||||
@@ -10,6 +19,20 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
gate:
|
||||
runs-on: game-maker-ci
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install
|
||||
run: npm ci --no-audit --no-fund
|
||||
|
||||
- name: Gate
|
||||
run: ./check.sh
|
||||
env:
|
||||
GM_TEST_WORKERS: 2
|
||||
|
||||
suite:
|
||||
runs-on: game-maker-ci
|
||||
timeout-minutes: 45
|
||||
@@ -25,9 +48,6 @@ jobs:
|
||||
- name: Install
|
||||
run: npm ci --no-audit --no-fund
|
||||
|
||||
- name: Gate
|
||||
run: ./check.sh
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
|
||||
Reference in new issue
Block a user