mirror of
https://git.yoctoproject.org/meta-raspberrypi
synced 2026-10-22 18:08:11 +00:00
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>
This commit is contained in:
6 files changed
+32
-31
No files matched your search
@@ -26,7 +26,7 @@ runs:
|
||||
run: |
|
||||
# Images older than max_age_days are rebuilt so that base image and
|
||||
# package updates are picked up.
|
||||
# Keep docker-prune-images at twice this.
|
||||
# Keep docker-cleanup at twice this.
|
||||
max_age_days=7
|
||||
tag="$(git rev-parse --short=12 HEAD:.github/workflows/docker-images)"
|
||||
image="${{ inputs.docker_image }}:$tag"
|
||||
|
||||
+10
-1
@@ -2,11 +2,20 @@
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: "Prune old CI docker images"
|
||||
name: "Cleanup CI docker containers and images"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Remove CI containers left on this runner
|
||||
shell: bash
|
||||
# A runner executes one job at a time, so any container labelled with
|
||||
# its name is left over from this job (e.g. after a cancellation) or a
|
||||
# previous one.
|
||||
run: |
|
||||
echo "Removing CI containers left by runner $RUNNER_NAME..."
|
||||
docker ps -aq --filter "label=meta-raspberrypi-ci.runner=$RUNNER_NAME" |
|
||||
xargs -r docker rm -f
|
||||
- name: Prune old CI docker images
|
||||
shell: bash
|
||||
# Only images built by docker-build carry the label. Keep this at twice
|
||||
Reference in new issue
Block a user