mirror of
https://git.yoctoproject.org/meta-raspberrypi
synced 2026-10-21 05:38:11 +00:00
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>
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
# SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com>
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
---
|
|
|
|
name: Yocto Compatible
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
yocto-check-layer:
|
|
name: Validate with yocto-check-layer
|
|
runs-on: [self-hosted, Linux]
|
|
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: Run yocto-check-layer
|
|
run: |
|
|
docker run --rm --security-opt apparmor=unconfined \
|
|
--label "meta-raspberrypi-ci.runner=$RUNNER_NAME" \
|
|
-v "$GITHUB_WORKSPACE:/work:ro" \
|
|
--env "BASE_REF=$GITHUB_BASE_REF" \
|
|
"${{ steps.docker.outputs.image }}" \
|
|
/entrypoint-yocto-check-layer.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()
|