Files
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

76 lines
2.5 KiB
YAML

# SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com>
#
# SPDX-License-Identifier: MIT
---
name: Builds
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: true
matrix:
# Tier 1: one machine per tune / kernel defconfig. All machines are
# signature checked by yocto-check-layer in yocto-layer.yml.
machine:
- raspberrypi0-wifi
- raspberrypi-armv7
- raspberrypi-armv8
- raspberrypi3-64
- raspberrypi4-64
- raspberrypi5
image: [rpi-test-image]
distro: [poky]
runs-on: [self-hosted, Linux]
name: ${{ matrix.machine }}/${{ matrix.image }}/poky/systemd
env:
DL_DIR: /var/lib/ci/yocto/downloads
SSTATE_DIR: /var/lib/ci/yocto/sstate
steps:
- name: Checkout the code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Check for Yocto relevant changes
id: changed-files-specific
uses: ./.github/actions/changed-files
- name: Build the yocto-builder image
id: docker
uses: ./.github/actions/docker-build
with:
docker_image: yocto-builder
if: steps.changed-files-specific.outputs.any_changed == 'true'
- name: Build the image
run: |
docker run --rm --security-opt apparmor=unconfined \
--label "meta-raspberrypi-ci.runner=$RUNNER_NAME" \
--security-opt seccomp=unconfined \
-v "$GITHUB_WORKSPACE:/work:ro" \
-v "$DL_DIR:$DL_DIR:rw" \
-v "$SSTATE_DIR:$SSTATE_DIR:rw" \
--env "BASE_REF=$GITHUB_BASE_REF" \
--env "MACHINE=${{ matrix.machine }}" \
--env "DISTRO=${{ matrix.distro }}" \
--env "IMAGE=${{ matrix.image }}" \
--env "DL_DIR=$DL_DIR" \
--env "SSTATE_DIR=$SSTATE_DIR" \
--ulimit "nofile=1024:1048576" \
"${{ steps.docker.outputs.image }}" \
/entrypoint-build.sh
if: steps.changed-files-specific.outputs.any_changed == 'true'
- name: Cleanup CI docker containers and images
uses: ./.github/actions/docker-cleanup
if: always()
- name: Cleanup dangling docker images
uses: ./.github/actions/docker-clean-dangling
if: always()