Skip to content

Commit

Permalink
Add separate file path matchers for Python and Go
Browse files Browse the repository at this point in the history
This will enable us to run fewer builds when we only modify files relevant to
one build or the other, as well as exclude builds entirely when modifying
README.md or other documentation not relevant to the code or tests entirely.
  • Loading branch information
mbrukman committed Aug 18, 2024
1 parent fb63857 commit 11ac661
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,48 @@

name: "Go"

# GitHub Actions does not support anchors:
# https://github.com/actions/runner/issues/1182
# so we need to duplicate paths below and manually keep them in sync.
on:
push:
branches: [ main ]
paths:
# Go source files
- '**/*.go'
# Go config files
- 'go.mod'
- 'go.sum'
# Go-relevant shell scripts
- 'go*.sh'
- 'regen.sh'
# Cross-language build files and scripts
- 'Makefile'
- 'json_to_yaml_test.sh'
# Test data
- 'testdata/**'
# Go CI configs
- '.github/workflows/go.yaml' # this file

pull_request:
branches: [ main ]
paths:
# Go source files
- '**/*.go'
# Go config files
- 'go.mod'
- 'go.sum'
# Go-relevant shell scripts
- 'go*.sh'
- 'regen.sh'
# Cross-language build files and scripts
- 'Makefile'
- 'json_to_yaml_test.sh'
# Test data
- 'testdata/**'
# Go CI configs
- '.github/workflows/go.yaml' # this file

schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
#
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,39 @@

name: "Python"

# GitHub Actions does not support anchors:
# https://github.com/actions/runner/issues/1182
# so we need to duplicate paths below and manually keep them in sync.
on:
push:
branches: [ main ]
paths:
# Python source files
- '**/*.py'
# Python config files
- 'requirements.txt'
# Cross-language build files and scripts
- 'Makefile'
- 'json_to_yaml_test.sh'
# Test data
- 'testdata/**'
# Python CI configs
- '.github/workflows/python.yaml' # this file

pull_request:
branches: [ main ]
# Python source files
- '**/*.py'
# Python config files
- 'requirements.txt'
# Cross-language build files and scripts
- 'Makefile'
- 'json_to_yaml_test.sh'
# Test data
- 'testdata/**'
# Python CI configs
- '.github/workflows/python.yaml' # this file

schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
#
Expand Down

0 comments on commit 11ac661

Please sign in to comment.