From f74c67da46a7c967f984f01e8b6c245f1ade07f5 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Mon, 19 May 2025 02:13:37 +0100 Subject: [PATCH] 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. --- .github/workflows/coverage.yml | 2 ++ .github/workflows/rtlmeter.yml | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index af79c09b6..aaa990d00 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 diff --git a/.github/workflows/rtlmeter.yml b/.github/workflows/rtlmeter.yml index 549da1950..0d575b03d 100644 --- a/.github/workflows/rtlmeter.yml +++ b/.github/workflows/rtlmeter.yml @@ -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