voorkant / voorkant-core

https://voorkant.org/
MIT License
2 stars 3 forks source link

screenshots in CI #70

Open Habbie opened 3 months ago

Habbie commented 3 months ago

As we keep adding features, and often, in the process, remodeling other things, it would be nice if Github Actions could give us screenshots of various things as part of the CI process.

This ticket is not about "how to get screenshots", I'm sure we can figure that out in LVGL or SDL. This ticket is about how to get those screenshots out of the workflow and into our eyes.

Easy: stick screenshots into artifacts, which generates a .zip we can download and view. Functional, but awkward.

Untested: apparently step summaries can be one megabyte (unclear whether this limit is per step, per job or per workflow), which could fit quite a bit of PNG in data: I think. This idea is worth testing.

Icky: pull_request_target with enough permissions to generate actual comments. This is hard to do securely.

Clever: pull_request_target with no permissions, except a narrow API token that can dump images into some secondary repository. That secondary repo could use gh-pages, or just be visible via raw.githubusercontent with links in the job summary. Thanks to @jsoref for this idea.

More infra: have a server somewhere, running some software (perhaps Trifecta), and have a API token (still secret!) for that.

For any idea involving an API secret, note that we can do the 'talking to that API' from a step that involves as little code as possible, by having the usual testing/screenshotting workflow permissionless and uploading an artifact, and having the 'powerful' workflow download the artifacts and putting them in the right place, via that API secret.

Habbie commented 3 months ago

https://github.com/100askTeam/lv_lib_100ask/tree/master/src/lv_100ask_screenshot (MIT license) might be interesting.