CI: Add variable to explicitly enable some GitHub workflows (#6021)

To run scheduled instances of the RTLMeter or coverage workflows, the
ENABLE_SCHEDULED_JOBS variable must explicitly be set to 'true' in the
repository settings. This enables each fork to decide whether to run the
scheduled instances or not.
This commit is contained in:
Geza Lore 2025-05-19 02:13:37 +01:00 committed by GitHub
parent 27eb8cfe8a
commit f74c67da46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -26,6 +26,8 @@ defaults:
jobs:
Build:
# Only run scheduled jobs if explicitly enabled for that repo (e.g.: not on forks)
if: ${{ github.event_name != 'schedule' || vars.ENABLE_SCHEDULED_JOBS == 'true' }}
runs-on: ubuntu-24.04
env:
CI_BUILD_STAGE_NAME: build

View File

@ -24,6 +24,8 @@ concurrency:
jobs:
build-gcc:
name: Build GCC
# Only run scheduled jobs if explicitly enabled for that repo (e.g.: not on forks)
if: ${{ github.event_name != 'schedule' || vars.ENABLE_SCHEDULED_JOBS == 'true' }}
uses: ./.github/workflows/reusable-rtlmeter-build.yml
with:
runs-on: ubuntu-24.04
@ -31,6 +33,8 @@ jobs:
build-clang:
name: Build Clang
# Only run scheduled jobs if explicitly enabled for that repo (e.g.: not on forks)
if: ${{ github.event_name != 'schedule' || vars.ENABLE_SCHEDULED_JOBS == 'true' }}
uses: ./.github/workflows/reusable-rtlmeter-build.yml
with:
runs-on: ubuntu-24.04
@ -119,7 +123,9 @@ jobs:
combine-results:
name: Combine results
needs: [run-gcc, run-clang]
if: ${{ always() }} # Run even if dependencies failed
# Run if any of the dependencies have run, even if failed.
# That is: do not run if all skipped, or the workflow was cancelled.
if: ${{ (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')) && !cancelled() }}
runs-on: ubuntu-24.04
steps:
- name: Download all GCC results