mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
.github: alternative fix to issue #1154
Here we use a check-trigger job that all the others depend on, which should prevent duplicate workflows starting a bit more elegantly than killing one of them with the concurrency checker. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -14,22 +14,41 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Gate all builds through this check to prevent wasted runs. Only run on
|
||||
# 'labeled' events when the label is actually 'ci:main'. Concurrency control
|
||||
# above handles canceling the 'opened' event when 'labeled' arrives quickly
|
||||
# after (e.g., when creating a PR with ci:main already attached). See #1154.
|
||||
check-trigger:
|
||||
if: |
|
||||
startsWith(github.repository, 'kernelkit/') &&
|
||||
(github.event_name != 'pull_request' ||
|
||||
github.event.action != 'labeled' ||
|
||||
github.event.label.name == 'ci:main')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: |
|
||||
echo "Triggering build, logging meta data ..."
|
||||
echo "Event : ${{ github.event_name }}"
|
||||
echo "Action : ${{ github.event.action }}"
|
||||
echo "Ref : ${{ github.ref }}"
|
||||
echo "PR : ${{ github.event.pull_request.number }}"
|
||||
echo "Label : ${{ github.event.label.name }}"
|
||||
|
||||
build-x86_64:
|
||||
if: startsWith(github.repository, 'kernelkit/')
|
||||
needs: check-trigger
|
||||
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/')
|
||||
needs: check-trigger
|
||||
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:
|
||||
@@ -37,6 +56,5 @@ jobs:
|
||||
name: "infix"
|
||||
|
||||
test-publish-x86_64:
|
||||
if: startsWith(github.repository, 'kernelkit/')
|
||||
needs: test-run-x86_64
|
||||
uses: ./.github/workflows/publish.yml
|
||||
|
||||
Reference in New Issue
Block a user