From bc4cf1423799d37642a6da98b41ea2aca957d69c Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Wed, 28 May 2025 14:29:13 -0700 Subject: [PATCH] CI: Add PR label for skipping all CI jobs --- .cirrus.yml | 12 +++++++++--- .github/workflows/generate-docs.yml | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 52cc32d730..6d81f20090 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -68,13 +68,13 @@ skip_task_on_pr: &SKIP_TASK_ON_PR # Skip this task on PRs if it does not have the CI: Full label, # it continues to run for direct pushes to master/release. skip: > - ! ( $CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*CI: Full.*' ) + ( ! ($CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*CI: Full.*') || $CIRRUS_PR_LABELS =~ '.*CI: Skip All' ) skip_cluster_test_on_pr: &SKIP_CLUSTER_TEST_ON_PR # Skip this task on PRs if it does not have the CI: Full label, # it continues to run for direct pushes to master/release. skip: > - ! ( $CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*CI: (Full|Cluster Test).*') + ( ! ($CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*CI: (Full|Cluster Test).*') || $CIRRUS_PR_LABELS =~ '.*CI: Skip All' ) zam_skip_task_on_pr: &ZAM_SKIP_TASK_ON_PR # Skip this task on PRs unless it has the "CI: Full" or "CI: ZAM" label @@ -82,7 +82,7 @@ zam_skip_task_on_pr: &ZAM_SKIP_TASK_ON_PR # It continues to run for direct pushes to master/release, as # CIRRUS_PR will be empty. skip: > - ! ( $CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*CI: (Full|ZAM).*' || changesInclude('src/script_opt/**') ) + ( ! ($CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*CI: (Full|ZAM).*' || changesInclude('src/script_opt/**')) || $CIRRUS_PR_LABELS =~ '.*CI: Skip All' ) benchmark_only_if_template: &BENCHMARK_ONLY_IF_TEMPLATE # only_if condition for cron-triggered benchmarking tests. @@ -136,6 +136,10 @@ ci_template: &CI_TEMPLATE # Evit some of the cached build artifacts not used in this build. CCACHE_MAXSIZE=${ZEEK_CCACHE_PRUNE_SIZE} ccache -c + # Always skip all tasks on a PR if the "CI: Skip All" label is applied. + skip: > + $CIRRUS_PR != '' && $CIRRUS_PR_LABELS =~ '.*CI: Skip All.*' + env: CIRRUS_WORKING_DIR: /zeek ZEEK_CI_CPUS: *CPUS @@ -532,6 +536,8 @@ windows_task: # Give verbose error output on a test failure. CTEST_OUTPUT_ON_FAILURE: 1 << : *BUILDS_ONLY_IF_TEMPLATE + skip: > + $CIRRUS_PR != '' && $CIRRUS_PR_LABELS =~ '.*CI: Skip All.*' # Container images diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index b822ca8f5a..af58b61e3f 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -16,7 +16,7 @@ jobs: generate: permissions: contents: write # for Git to git push - if: github.repository == 'zeek/zeek' + if: "github.repository == 'zeek/zeek' && contains(github.event.pull_request.labels.*.name, 'CI: Skip All') == false" runs-on: ubuntu-24.04 steps: