ci: run the fast suite on pushes to master - #470
Merged
Conversation
build.yml triggers on workflow_dispatch, test.yml on pull_request, and test_build.yml on pull_request plus workflow_dispatch. Nothing listens to push, so `git push origin master` runs no checks at all. That was invisible while every change arrived as a pull request from a fork; it stops being invisible now that contributors branch inside this repository and can push to master directly. test.yml is the suite that belongs on this trigger: npm audit, npm run check, npm test and cargo test on one ubuntu-22.04 runner. test_build.yml is deliberately left on pull_request only -- three platform builds, and its own comment records macOS jobs waiting 20-30 minutes for a runner slot. Scoped to master. Pull request branches already run through the pull_request trigger above, so an unrestricted push trigger would run every branch twice without covering anything new. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nothing in this repository runs on a push.
That was harmless for as long as every change arrived as a pull request from a
fork — there was no other way in. It stops being harmless now that contributors
branch inside this repository:
git push origin masteris a single command thatlands code on the default branch and runs
npm audit,npm run check,npm testandcargo testexactly zero times. Nothing warns you, becausenothing failed; there simply is no run.
This adds
pushonmasterto test.yml only.Why test.yml and not test_build.yml
test.yml is one
ubuntu-22.04job: apt deps,npm ci,npm audit,npm run check,npm test,cargo test. It is the check that answers "doesthis commit still work", and it is cheap enough to run on every commit that
reaches master.
test_build.yml stays on
pull_requestonly. I read it before agreeing withyou, and the file argues its own case: three platforms (
macos-latestuniversal,ubuntu-22.04,windows-latest), each running the suites and a fulltauri build, and its comment records that macOS jobs "finish in 6-8 minutes butwere waiting 20-30 for a slot" from a pool "an order of magnitude smaller than
the Linux and Windows ones" (#361). Putting it on push means paying that matrix
a second time for every merge, for a build of code that a pull request already
built minutes earlier.
The honest residual gap: a direct push to master that breaks packaging —
an NSIS hook, a bundle path, a
Cargo.tomlfeature that only fails on Windows —is not caught by this PR. test.yml runs on Linux only. That gap already exists,
it is not made worse here, and test_build.yml already carries
workflow_dispatchso you can run the platform matrix on master on demand before cutting a release.
If you would rather close it,
push: branches: [master]on test_build.yml is atwo-line follow-up — I did not assume the cost was yours to accept.
Concurrency: checked, and the report was inverted
build.yml has no
concurrencyblock.grep -rn concurrency .github/workflows/returns exactly one hit, and it is in test_build.yml, added in #361 for the
expensive matrix:
So the thing that "does something with concurrency" is the workflow this PR is
choosing not to touch.
Does merging then run the same commit twice? No, and a concurrency group
could not fix it if it did:
(#N)and a singleparent lineage — so the SHA on master is a new object. The
pull_requestruntested
refs/pull/N/merge, which is a third object again. There is no committhat gets tested twice.
${{ github.workflow }}-${{ github.ref }}puts the pull requestrun in
Test-refs/pull/468/mergeand the push run inTest-refs/heads/master.Different groups. Concurrency de-duplicates runs within a ref; it has no
mechanism to cancel a run on a different one. It is the wrong instrument for
the stated worry.
So the extra run per merge is real — one ubuntu runner, one fast suite, per
merge — and I want to be straight that it is a cost you are taking on, not a
free win. What it buys: the
pull_requestrun tested head merged into base asof when it ran. If master moves after that, the result is stale, and the push
run is the only thing that tests what master actually contains. That is not
hypothetical here — on 2026-08-05, #462, #463 and #464 merged at 14:33, 14:38
and 14:40, inside seven minutes of each other.
A concurrency group on test.yml would be worth having for a different reason —
rapid pushes to a pull request branch queue redundant runs, which is exactly why
#361 added one to test_build.yml. I left it out because this PR should be the
trigger and nothing else, and because it needs care: a blanket
cancel-in-progress: truewould let a fast follow-up push to master cancel theonly run that was ever going to test the commit underneath it. The correct form
is
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}. Say the wordand it is a separate three-line PR.
Verification
The failure mode for a workflow edit is not a red X, it is silence — a malformed
file simply never runs, which is the same class of defect as #460 (an installer
hook that was never called and produced no error). So:
YAML.parseon all three workflow files, using theyamlpackage already in this repo's lockfile, printing the resulting triggerobject. test.yml now yields
{"pull_request":null,"push":{"branches":["master"]}},and build.yml and test_build.yml are byte-identical to master and parse
unchanged. This also produced the
concurrencyfindings above rather than myreading for them.
Testcheck on thispull request is produced from this branch's copy of test.yml, so a file
Actions could not read would show up here as a failed run with a workflow
annotation, or as no run at all. Run
31062189024
—
event=pull_request, conclusion success, every step green throughnpm audit,check frontend,run frontend behavior testsandrun cargo test.gh api repos/sftwrdotdev/Markpad/actions/workflowsstilllists all three workflows as
state=active, with test.yml at its unchangedpath.
master, sopushing this branch does not exercise it; the first real proof is the first
commit that lands on master after this merges. I would rather say that than
imply I watched it work.
npm run check— 645 files, 0 errors.npm test— 692 pass, 0 fail. Run on aclean checkout of this branch. I touched no source, so this is a
"nothing broke" baseline, not a claim about the change.
scripts/workflowSecurityAudit.test.tsreads.github/workflows/test.ymlandasserts the
npm auditstep; it is green, so the trigger addition did notdisturb the shape that test pins.
Your call
This changes what runs when you push, which is something you live with on every
commit and I do not. The extra ubuntu run per merge is the price; a commit on
master that nothing has ever tested is what it buys off. If you would rather
have the coverage without the duplicate, the alternative is to keep test.yml on
pull_requestand instead protect master so nothing can be pushed to itdirectly — that is a repository setting, not a file, and it is yours to make.
I deliberately did not add a guard test asserting the trigger, even though this
repository would normally pin a fact like this in
scripts/, because other workis in flight in that directory right now. Happy to add one after.