CI: Add running RTLMeter workflow on selective PRs (#6271)
Runs RTLMeter on PRs if the PR has the 'pr: rtlmeter' label applied to it. This should make it easy to selectively require the RTLMeter workflows to pass on a PR that is potentially invasive, per our own judgement.
This commit is contained in:
parent
188a12f609
commit
b2388faa5e
|
|
@ -9,6 +9,13 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 2 * * *' # Daily, starting at 02:00 UTC
|
- cron: '0 2 * * *' # Daily, starting at 02:00 UTC
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -18,14 +25,29 @@ defaults:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: RTLMeter
|
group: ${{ github.ref }}
|
||||||
cancel-in-progress: false
|
cancel-in-progress: ${{ github.event_name != 'schedule' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
start:
|
||||||
|
name: Start
|
||||||
|
# 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 RTLMeter 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: rtlmeter')) ||
|
||||||
|
(github.event_name == 'workflow_dispatch')
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Startup
|
||||||
|
run: echo
|
||||||
|
|
||||||
build-gcc:
|
build-gcc:
|
||||||
name: Build GCC
|
name: Build GCC
|
||||||
# Only run scheduled jobs if explicitly enabled for that repo (e.g.: not on forks)
|
needs: start
|
||||||
if: ${{ github.event_name != 'schedule' || vars.ENABLE_SCHEDULED_JOBS == 'true' }}
|
|
||||||
uses: ./.github/workflows/reusable-rtlmeter-build.yml
|
uses: ./.github/workflows/reusable-rtlmeter-build.yml
|
||||||
with:
|
with:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
@ -33,8 +55,7 @@ jobs:
|
||||||
|
|
||||||
build-clang:
|
build-clang:
|
||||||
name: Build Clang
|
name: Build Clang
|
||||||
# Only run scheduled jobs if explicitly enabled for that repo (e.g.: not on forks)
|
needs: start
|
||||||
if: ${{ github.event_name != 'schedule' || vars.ENABLE_SCHEDULED_JOBS == 'true' }}
|
|
||||||
uses: ./.github/workflows/reusable-rtlmeter-build.yml
|
uses: ./.github/workflows/reusable-rtlmeter-build.yml
|
||||||
with:
|
with:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
@ -53,7 +74,7 @@ jobs:
|
||||||
executeArgs: ""
|
executeArgs: ""
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 2
|
max-parallel: ${{ github.event == 'schedule' && 2 || 7 }}
|
||||||
matrix:
|
matrix:
|
||||||
cases:
|
cases:
|
||||||
- "NVDLA:*"
|
- "NVDLA:*"
|
||||||
|
|
@ -94,7 +115,7 @@ jobs:
|
||||||
executeArgs: ""
|
executeArgs: ""
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 2
|
max-parallel: ${{ github.event == 'schedule' && 2 || 7 }}
|
||||||
matrix:
|
matrix:
|
||||||
cases:
|
cases:
|
||||||
- "NVDLA:*"
|
- "NVDLA:*"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue