Commit Graph
9 Commits
Author SHA1 Message Date
Andrei Gherzan 67d7736ed4 ci: cancel superseded runs with native concurrency groups
cancel-redundant-workflows.yml had some overhead as it was spawning an extra
workflow_run job per workflow. With concurrency groups, a new push cancels the
PR's previous run directly.

A cancelled step can leave its docker container running against the shared
sstate.  Label containers with the runner name and remove them in the cleanup
step. Rename docker-prune-images to docker-cleanup accordingly.

Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
2026-10-19 04:47:47 +01:00
Andrei Gherzan df3c09e34c ci: reuse docker images across jobs
We were rebuilding Docker images from scratch with --no-cache, tagged by PR
number. With this, we were building multiple images per PR for the same
context.

This change tags the images by the git tree hash of the build context and only
build if the tag is missing. This naturally covers rebuilding on build context
changes.

Finally, this change handles refreshing images every 7 days (for example to
refresh OS packages) and prune by CI label after 14 days. The gap ensures an
image a running job just picked up isn't pruned under it.

Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
2026-10-19 04:47:45 +01:00
Andrei Gherzan 3efe6589e8 ci: replace tj-actions/changed-files with a local action
Drop the dependency on tj-actions/changed-files and replace it with a local
composite action. Especially given it was compromised in the past - see
CVE-2025-30066.

The action diffs HEAD^1..HEAD of the PR merge commit that actions/checkout
checks out by default. It fails if HEAD is not a merge commit, so a change to
the checkout ref can't silently diff the wrong range.

With this in place, both of the workflows can share a consistent list of paths.

Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
2026-10-19 04:47:42 +01:00
Andrei Gherzan 6c1080f564 ci: fix retry exit check in docker build
If the retry succeeds at the 3rd try, the final check would have failed.

Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
2026-10-19 04:47:41 +01:00
Martin Jansa 03981f9365 docker-build: use --no-cache
* --no-cache is needed to actually call apt update instead of using it
  from docker cache and then failing to fetch pruned packages as shown:
  https://github.com/agherzan/meta-raspberrypi/actions/runs/16327036376/job/46119768952?pr=1491

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-07-17 08:28:56 -07:00
Zygmunt Krynicki c573499166 ci: fix typo: unconditionally
Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
2022-10-11 18:58:35 +01:00
Andrei Gherzan 3786353f51 ci: Define an action for cleaning/removing an image
This is useful when cleaning up after a temporary built docker image.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
2022-02-19 09:27:59 +00:00
Andrei Gherzan 2906a95cff ci: Define an action for cleaning dangling image
Cleanup existing dangling docker images on the runner.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
2022-02-19 09:27:59 +00:00
Andrei Gherzan 8b1ab71006 ci: Define an action for building a local docker image
It provides support for building a locally defined image. It also
includes a retry logic to handle eventual concurrent cleanups on the
runner.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
2022-02-19 09:27:59 +00:00