ci: refresh README screenshots on a hosted emulator - #383
Merged
Conversation
The Screenshots workflow (workflow_dispatch) boots a headless API 35 google_apis emulator with KVM and a cached AVD snapshot, runs scripts/screenshots.sh with both clocks pinned, uploads the suite's output as an artifact and opens a pull request on chore/refresh-screenshots with the changed images and README. Inputs: screens, clock, dry_run. A temporary push trigger on this branch validates the run before merge. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The emulator-runner action executes its script input line by line with /bin/sh, which rejected the bash array in the retry logic. Co-Authored-By: Claude Fable 5.1 <[email protected]>
On the hosted emulator the launcher raised an "isn't responding" dialog during the cold boot that produced the AVD snapshot, and while such a dialog is up the app's window is absent from the accessibility tree, so every marker timed out. The suite now taps Wait/Close (by the system's button ids) before and during each wait, and the snapshot step sets hide_error_dialogs so restored boots raise no new ones. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Validated in three branch runs; the third captured 11/11 screens in 8m45s. Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.
What this does
PR 2 of the screenshot plan, on top of #381 (replaces #382, which GitHub closed when its base branch was deleted). Adds the Screenshots GitHub Actions workflow: run it by hand after a UI change and it boots a headless emulator on a hosted runner, captures the gallery from demo mode with the suite from #381, and opens a pull request on
chore/refresh-screenshotswith the changed images and README block. No PR is opened when nothing changed.How it works
workflow_dispatchwith inputsscreens(subset of spec ids),clock(override the pinned instant) anddry_run(artifacts only). One run at a time via a concurrency group.google_apisx86_64 on thepixel_6profile (1080×2400 at 420 dpi, the geometry the current gallery came from), software GPU,Europe/Madridtimezone, animations off. The AVD snapshot is cached between runs; the first run also setshide_error_dialogsbefore the snapshot is saved.scripts/screenshots.sh, the same entry point as locally, called through.github/scripts/capture-screenshots.sh(the emulator-runner action executes eachscriptline with/bin/sh, so the retry and the logcat dump live in a bash helper). Thegoogle_apisimage is rootable, so the script pins device clock and demo clock together and a same-day re-run is pixel-identical.logcat.txtwhen both attempts fail.peter-evans/create-pull-requestopens the PR with the workflow token. That means CI does not run on the refresh PR (only images and README change) and the repository setting Allow GitHub Actions to create and approve pull requests must be on. I enabled it.Found and fixed while validating on the branch
Validation
Three validation runs on this branch (temporary
pushtrigger):/bin/shscript lineThe images from run 3 are in its
screenshots-outputartifact; they are not committed here because the PR step is skipped on branch runs. The firstworkflow_dispatchafter merge will open the refresh PR.The temporary
pushtrigger used for validation has been removed; onlyworkflow_dispatchremains. First real dispatch after merge will exercise the PR-opening step, which the branch runs skipped by design.🤖 Generated with Claude Code