From 8c2fc6442597f4a1807ea7efded0a19472a2d711 Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Mon, 11 Mar 2024 21:35:17 -0700 Subject: [PATCH] Improve workflow filters Run the ci_workflow and website_workflow only on changes to the appropriate source files and workflow files. Signed-off-by: Cary Phillips --- .github/workflows/ci_workflow.yml | 27 +++++++++++--------------- .github/workflows/website_workflow.yml | 15 +++++--------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 33670f472c..746f67951d 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -6,18 +6,16 @@ name: CI -# Skip the run on *.md changes and on changes to the website, *except* -# for "website/src", since that code needs validation. There's a -# separate workflow for with website. Also, no need to run on changes -# to the bazel setup. +# Run on all changes except: +# - doc file changes +# - changes to the website, *except* for "website/src", since that +# code needs validation. The website has a separate workflow +# - changes to the bazel config, since it has its own workflow +# - changes to the python bindings +# - changes to workflows other than this one on: push: - branches-ignore: - - RB-2.* - tags-ignore: - - v1.* - - v2.* paths: - '**' - '!**.md' @@ -25,13 +23,9 @@ on: - 'website/src/**' - '!bazel/**' - '!src/wrappers/**' - - '!.github/workflows/python-**.yml' + - '!.github/workflows/**' + - '.github/workflows/ci_workflow.yml' pull_request: - branches-ignore: - - RB-2.* - tags-ignore: - - v1.* - - v2.* paths: - '**' - '!**.md' @@ -39,7 +33,8 @@ on: - 'website/src/**' - '!bazel/**' - '!src/wrappers/**' - - '!.github/workflows/python-**.yml' + - '!.github/workflows/**' + - '.github/workflows/ci_workflow.yml' permissions: contents: read diff --git a/.github/workflows/website_workflow.yml b/.github/workflows/website_workflow.yml index f960d97c44..48ad3a4035 100644 --- a/.github/workflows/website_workflow.yml +++ b/.github/workflows/website_workflow.yml @@ -6,29 +6,24 @@ name: Website -# Run only on changes in the "website" directory. +# Run only on changes in the "website" directory or workflow file. # Skip the release branches, since the website is built from main. on: - workflow_dispatch: push: branches:-ignore: - - RB-2.* - - RB-3.* - tags-ignore: - - v3.[0-9]+.[0-9]+-rc* + - RB-* paths: - 'website/**' + - '.github/workflows/website_workflow.yml' pull_request: branches:-ignore: - - RB-2.* - - RB-3.* - tags-ignore: - - v3.[0-9]+.[0-9]+-rc* + - RB-* paths: - 'website/**' + - '.github/workflows/website_workflow.yml' permissions: contents: read