Skip to content

ci: refresh README screenshots on a hosted emulator - #383

Merged
vide merged 4 commits into
mainfrom
feat/screenshots-workflow
Sep 10, 2026
Merged

ci: refresh README screenshots on a hosted emulator#383
vide merged 4 commits into
mainfrom
feat/screenshots-workflow

Conversation

@vide

@vide vide commented Sep 10, 2026

Copy link
Copy Markdown
Owner

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-screenshots with the changed images and README block. No PR is opened when nothing changed.

How it works

  • workflow_dispatch with inputs screens (subset of spec ids), clock (override the pinned instant) and dry_run (artifacts only). One run at a time via a concurrency group.
  • KVM enabled on the runner, API 35 google_apis x86_64 on the pixel_6 profile (1080×2400 at 420 dpi, the geometry the current gallery came from), software GPU, Europe/Madrid timezone, animations off. The AVD snapshot is cached between runs; the first run also sets hide_error_dialogs before the snapshot is saved.
  • The capture is scripts/screenshots.sh, the same entry point as locally, called through .github/scripts/capture-screenshots.sh (the emulator-runner action executes each script line with /bin/sh, so the retry and the logcat dump live in a bash helper). The google_apis image is rootable, so the script pins device clock and demo clock together and a same-day re-run is pixel-identical.
  • Every run uploads the suite's output directory as an artifact: the images, and for failed screens a hierarchy dump and a raw frame, plus logcat.txt when both attempts fail.
  • peter-evans/create-pull-request opens 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

  • The launcher raised an "isn't responding" dialog during the cold boot that produced the AVD snapshot. While such a dialog is up the app's window is absent from the accessibility tree, so every marker timed out. The suite now dismisses ANR and crash dialogs (by the system's button ids, locale-independent) before and during each wait.

Validation

Three validation runs on this branch (temporary push trigger):

Run Outcome Cause
1 failed in 2 min bash syntax in a /bin/sh script line
2 failed in 28 min launcher ANR dialog hid the app window from UiAutomator
3 green in 8m45s, 11/11 captured compile ~5 min, capture 85 s, both clocks pinned

The images from run 3 are in its screenshots-output artifact; they are not committed here because the PR step is skipped on branch runs. The first workflow_dispatch after merge will open the refresh PR.

The temporary push trigger used for validation has been removed; only workflow_dispatch remains. First real dispatch after merge will exercise the PR-opening step, which the branch runs skipped by design.

🤖 Generated with Claude Code

vide and others added 4 commits September 10, 2026 11:38
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]>
@vide
vide merged commit c8339eb into main Sep 10, 2026
1 check passed
@vide
vide deleted the feat/screenshots-workflow branch September 10, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant