Repository navigation
GitHub Action
Role. Run Omnisnap on a pull request across Linux, Windows and macOS runners (macOS for real Safari), merge the three bundles into one report, and post one PR comment, updated in place on every push. Report-only: every job concludes success, whatever it finds. Module ci-action.
How to set it up in a repository is in docs/github-action-setup.md, action/README.md and the README; this page is about how it works.
| File | What it is |
|---|---|
.github/workflows/report.yml |
The reusable workflow a consumer calls: the OS jobs, the merge job, the comment. |
action/action.yml |
The composite action each OS job runs: get the binary, prepare engines, start the app, capture, upload. Usable on its own. |
action/linux-engines.sh |
Linux engine setup: parity fonts, plus Weston and WebKitGTK when wanted, cached and time-bounded. |
.github/workflows/report-comment.yml |
The fork-safe comment: a reusable workflow a consumer calls from a workflow_run follow-up. |
.github/workflow-templates/ |
The fork follow-up template (docs/github-action-fork-comments.md). |
One tag gives both refs: report.yml@v0.2.0-rc.5 and the action's version input default to the same release, whose assets are named omnisnap_<version>_<os>_<arch>[.exe].
flowchart LR
PR[pull_request] --> C1[capture<br/>ubuntu-latest]
PR --> C2[capture<br/>windows-latest]
PR --> C3[capture<br/>macos-latest<br/>Safari]
C1 -->|artifact omnisnap-ubuntu-latest| M[merge and comment<br/>ubuntu-latest]
C2 -->|artifact| M
C3 -->|artifact| M
M -->|omnisnap-merged artifact| R[(merged report)]
M -->|same-repo PR| K[one comment,<br/>updated in place]
The matrix is chosen in strategy, from the macos input: every (the default) adds macos-latest; labelled adds it only on PRs labelled omnisnap:safari; never drops it. It cannot be a job if: jobs.<job_id>.if cannot read the matrix context, so GitHub rejected the file (report.yml). Each job checks out the caller's repository (the app under test) and the action beside it, then runs the composite action (action.yml):
-
Get the binary: download the release asset and its
SHA256SUMSwithcurl, and check it withsha256sum -c --ignore-missing(the asset keeps its own name, sinceSHA256SUMSlists it by that name). Thebinaryinput skips this for self-tests and air-gapped setups. -
Linux engines (
linux-engines.sh):plandecides whether WebKitGTK is wanted and computes a cache key from the runner image; the.debs are restored from the Actions cache, and on an exact hit installed withdpkgwithout downloading. On a miss, downloads run undersetup-timeout(300 s by default); past it the step warns and moves on. Chrome and Firefox ship with the image, so a slow Ubuntu mirror loses WebKitGTK, not the whole Linux host. -
macOS:
sudo safaridriver --enable. -
Start the app (the
startinput, in the background) and wait forwait-on. -
Write the job from the
pages,engines,baselineandrunsinputs, and capture:omnisnap run --max-browsers 4(the flag only when the binary's--helplists it, so a pinned olderversionstill captures). Four, not the CLI's default of 3, somacos-latest(Chrome, Edge, Firefox, Safari) captures in one group instead of Safari alone in a second one. A non-zero exit (3: every capture failed) becomes a::warning::and the step exits 0.bash -e -o pipefailwould otherwise have ended the step before the code was read. -
Upload the bundle as
omnisnap-<os>, with one retry; a warning if it still fails. - Stop the app.
needs: capture and if: always(), so it runs whatever the OS jobs did (report.yml). It downloads this call's bundles (the pattern <artifact-prefix>-*-latest, which matches every capture job's label and never a -merged artifact or another call's), gets the Linux binary (checksum verified), runs omnisnap merge, renders omnisnap comment into merged/comment.md, uploads <artifact-prefix>-merged, and, on a same-repository pull request, posts or updates the one comment: it lists the PR's comments, finds the one containing <!-- omnisnap-report -->, and updates it, or creates one (report.yml).
Artifact names are unique within a workflow run, and reusable workflows called from one run share it. Each capture job uploads <artifact-prefix>-<os>, and the merge job uploads <artifact-prefix>-merged. The artifact-prefix input defaults to omnisnap, which gives consumers omnisnap-ubuntu-latest … omnisnap-merged. A run that calls report.yml more than once gives each call its own prefix. The release run is one: the website demo keeps omnisnap, the reusable-workflow self-test uses selftest-report, and the composite-action self-test names its own selftest-action-* (Testing and CI). No prefix may be another one followed by -, or one merge's pattern would match the other call's artifacts.
A pull_request run started by a fork gets a read-only token and cannot comment. The consumer adds a workflow_run follow-up that calls report-comment.yml: it runs in the base repository with its token, downloads the omnisnap-merged artifact, and posts the same comment. It never checks out or runs fork code. GitHub runs a workflow_run workflow only if its file is on the default branch.
| What fails | What happens |
|---|---|
| A capture, or every capture on one OS | a warning; the job succeeds; the merge uses what was uploaded |
| A whole OS job | the merge still runs (if: always()) |
| The Linux engine downloads are too slow | a warning; capture with Chrome and Firefox |
| The upload | one retry, then a warning |
-
e2e-action.yml: builds the binary from the tag it is given (or the ref the run started from), runs./actionon the planted suite on Linux, Windows and macOS, merges the bundles and checks that the planted finding reaches the comment. Windows injects the failure: it does not serve the pages, every capture there fails, and the job must still succeed. A capture that failed because its browser painted none of the page's text fails the self-test (backlog B17). Every release run calls it, and npm and PyPI wait for it (Release process). Its artifacts areselftest-action-*. -
e2e-report.yml: callsreport.ymlitself, withartifact-prefix: selftest-report: on manual dispatch, on pull requests touchingreport.ymloraction/, and from every release run with the tag, once the release's assets are up (npm and PyPI wait for it). With a tag it tests that release's binary and fails early when the release has noSHA256SUMS; without one, the newest release that has it. Its assert job fails when a per-OS bundle holds a capture its browser left unpainted (backlog B17). It exists becausee2e-action.ymlnever ranreport.yml, which letv0.1.0-rc.2ship with two consumer-breaking bugs. - See Testing and CI.
-
Artifact retention is not applied. The
artifact-retention-daysinput only prints a line ("set in the repository settings",report.yml); the spec's open question (apply it through the API, or leave it to the repository setting) is not closed in code.
specs/SPEC-ci-action.md and specs/SPEC-ci-action-fork-template.md.
-
action/action.yml: the composite action -
action/linux-engines.sh: installs the Linux engines on a runner -
action/README.md: the action's own README -
.github/workflows/report.yml: the reusable workflow -
.github/workflows/report-comment.yml: the fork-safe comment -
.github/workflows/e2e-action.yml: tests the action -
.github/workflows/e2e-report.yml: tests the reusable workflow
This wiki is published from docs/internals/ on main. Edits made here are overwritten on the next publish: change the pages there, in a pull request. The specs are normative; where a page and a spec disagree, the page says what the code does.
Start
Contracts
Capture side
Analysis side
Output
Quality