Skip to content

Commit

Permalink
Improve workflow filters
Browse files Browse the repository at this point in the history
Run the ci_workflow and website_workflow only on changes to the
appropriate source files and workflow files.

Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Mar 12, 2024
1 parent f0da5b7 commit 8c2fc64
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,35 @@

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'
- '!website/**'
- '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'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/python-**.yml'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow.yml'

permissions:
contents: read
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/website_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c2fc64

Please sign in to comment.