Repository navigation
ci: run the screenshot job in the toolchain container - #35
Open
spacedevin wants to merge 1 commit into
Open
spacedevin wants to merge 1 commit into
spacedevin wants to merge 1 commit into
Conversation
screenshot.yml still assembled its toolchain by hand on every PR touching crates/**: apt (imagemagick, freetype, cmake...), a libmgba 0.10.5 source build behind an actions/cache, a rustup nightly with rust-src, `cargo install agb-gbafix` compiled from source every run, and setup-node. ci.yml's rom and verify jobs had already moved all of that into ghcr.io/schlopai/chuggie-toolchain; this was the one job left paying the old way, and it ran in parallel with a verify matrix that was building the same overworld-demo ROM. The job now runs in the same image, pinned to the same tag as ci.yml. The libmgba cache step goes with the rest of the setup: the library is prebuilt in the image at MGBA_PREFIX, which scripts/shot_common.sh already reads, so there is nothing left for the cache to hold. What the job proves is unchanged — build overworld-demo with the pinned tish, boot it under libmgba headless, upload the frame.
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.
Motivation
screenshot.ymlfires on every PR that touchescrates/**(most of them) and, in parallel with theverifymatrix, rebuilt its whole toolchain by hand:apt-get installof imagemagick/freetype/cmake/…, a libmgba 0.10.5 source build (cached, but only that one piece),dtolnay/rust-toolchainfor the nightly,cargo install --locked agb-gbafixcompiled from source every run, andsetup-node.ci.yml'sromandverifyjobs had already moved every one of those intoghcr.io/schlopai/chuggie-toolchain— the image's Dockerfile lists them as exactly the per-job cost it exists to remove — leaving this as the one job still paying the old way. It also builds the sameoverworld-demoROM thatverify overworld-demobuilds in the same PR run.Change
Of the two options (fold into
ci.yml, or reuse the container), this is the smaller one: the job keeps its own workflow, trigger paths, name and artifact, and only the setup changes.container:is the same image and the same tagci.ymlpins (8f52ecdbceed), with the samecredentials:block; a comment says to move the two together.permissions: { contents: read, packages: read }—packages: readis what the ghcr pull needs, as inci.yml.cargo install agb-gbafix,setup-node, and the explicitMGBA_PREFIX: /home/runner/mgba-prefixenv. The image setsMGBA_PREFIX=/usr/local/mgba, whichscripts/shot_common.sh'sfind_mgba_prefixreads first;ensure_gba_shotthen compilestools/gba-shot.cagainst it with the image'scc, andscreenshot.shfinds the image's ImageMagickconvertfor the PPM→PNG step.npm ci(with its comment about.cargo/config.toml's patch), thescreenshot.shinvocation withTISH, the upload step,timeout-minutes: 40.About the libmgba cache. The brief was to keep it; I removed it instead and want to flag that explicitly. In the container the library is prebuilt at
/usr/local/mgbaand nothing would ever populate or read~/mgba-prefix, so the cache step would be dead weight alongside aBuild libmgbastep that never runs. The property the cache was providing — not rebuilding libmgba per run — is what the image provides now. If you would rather keep the fallback path for a runner without the image, say so and I will put it back as a conditional.Verification
actionlintand a YAML parse are clean. Runtime check is the PR's own run of this workflow (it triggers on.github/workflows/screenshot.yml).Not done here
verify overworld-demoinci.ymlalready builds, boots and checks that this ROM draws something (scripts/verify_default.sh); the only thing this workflow adds is the uploaded PNG. Whether that is worth a separate ~2-minute job per PR is a product call, not made in this PR.