CI: Don't restart RTLMeter/Coverage on unrelated label changes (#8411)

This commit is contained in:
Geza Lore
2026-09-19 16:52:27 +01:00
committed by GitHub
parent 36aa3e88c7
commit 7400d28e6d
2 changed files with 35 additions and 7 deletions
+18 -4
View File
@@ -20,8 +20,18 @@ defaults:
shell: bash
concurrency:
# At most 1 job per branch. Auto cancel all but scheduled jobs
group: ${{ github.workflow }}-${{ github.ref }}
# At most 1 job per branch. Auto cancel all but scheduled jobs.
# Label events that do not concern the 'pr: dev-coverage' label are given a
# unique concurrency group, so they do not cancel a run that is in progress.
# This way adding the label starts a run, removing it cancels the in-progress
# run, and any other label change has no effect. Note such an event still
# creates a run of this workflow, which is skipped, and would then hide the
# one in progress on the pull request. 'pr-run-cleanup.yml' deletes those.
group: >-
${{ github.workflow }}-${{ github.ref }}-${{
(github.event.action == 'labeled' || github.event.action == 'unlabeled')
&& github.event.label.name != 'pr: dev-coverage'
&& github.run_id || 'shared' }}
cancel-in-progress: ${{ github.event_name != 'schedule' }}
jobs:
@@ -29,13 +39,17 @@ jobs:
build:
name: Build
# Only run scheduled jobs if explicitly enabled for that repo (e.g.: not on forks)
# Only run pull request jobs if labelled as needing an coverage run
# Only run pull request jobs if labelled as needing a coverage run
# Always run workflow dispatch jobs
if: |
(github.event_name == 'schedule'
&& vars.ENABLE_SCHEDULED_JOBS == 'true') ||
(github.event_name == 'pull_request'
&& contains(github.event.pull_request.labels.*.name, 'pr: dev-coverage')) ||
&& ((github.event.action == 'labeled'
&& github.event.label.name == 'pr: dev-coverage')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& contains(github.event.pull_request.labels.*.name, 'pr: dev-coverage')))) ||
(github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/reusable-build.yml
with:
+17 -3
View File
@@ -22,8 +22,18 @@ defaults:
shell: bash
concurrency:
# At most 1 job per branch. Auto cancel all but scheduled jobs
group: ${{ github.workflow }}-${{ github.ref }}
# At most 1 job per branch. Auto cancel all but scheduled jobs.
# Label events that do not concern the 'pr: rtlmeter' label are given a
# unique concurrency group, so they do not cancel a run that is in progress.
# This way adding the label starts a run, removing it cancels the in-progress
# run, and any other label change has no effect. Note such an event still
# creates a run of this workflow, which is skipped, and would then hide the
# one in progress on the pull request. 'pr-run-cleanup.yml' deletes those.
group: >-
${{ github.workflow }}-${{ github.ref }}-${{
(github.event.action == 'labeled' || github.event.action == 'unlabeled')
&& github.event.label.name != 'pr: rtlmeter'
&& github.run_id || 'shared' }}
cancel-in-progress: ${{ github.event_name != 'schedule' }}
jobs:
@@ -36,7 +46,11 @@ jobs:
(github.event_name == 'schedule'
&& vars.ENABLE_SCHEDULED_JOBS == 'true') ||
(github.event_name == 'pull_request'
&& contains(github.event.pull_request.labels.*.name, 'pr: rtlmeter')) ||
&& ((github.event.action == 'labeled'
&& github.event.label.name == 'pr: rtlmeter')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& contains(github.event.pull_request.labels.*.name, 'pr: rtlmeter')))) ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'push')
runs-on: ubuntu-26.04