mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 09:13:01 +02:00
Add concurrency control to trigger workflow to cancel in-progress builds when new events (like adding ci:main label) occur on the same PR. This prevents resource waste from duplicate builds and handles the common workflow where developers add the ci:main label after PR creation. Fixes #1154
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Kernelkit Trigger
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, labeled]
|
|
push:
|
|
branches:
|
|
- main
|
|
- ci-work
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ci-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-x86_64:
|
|
if: startsWith(github.repository, 'kernelkit/')
|
|
uses: ./.github/workflows/build.yml
|
|
with:
|
|
name: "infix"
|
|
target: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:main') && 'x86_64_minimal' || 'x86_64' }}
|
|
|
|
build-aarch64:
|
|
if: startsWith(github.repository, 'kernelkit/')
|
|
uses: ./.github/workflows/build.yml
|
|
with:
|
|
name: "infix"
|
|
target: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:main') && 'aarch64_minimal' || 'aarch64' }}
|
|
|
|
test-run-x86_64:
|
|
if: startsWith(github.repository, 'kernelkit/')
|
|
needs: build-x86_64
|
|
uses: ./.github/workflows/test.yml
|
|
with:
|
|
target: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:main') && 'x86_64_minimal' || 'x86_64' }}
|
|
name: "infix"
|
|
|
|
test-publish-x86_64:
|
|
if: startsWith(github.repository, 'kernelkit/')
|
|
needs: test-run-x86_64
|
|
uses: ./.github/workflows/publish.yml
|