GH workflows only trigger for relevant parts of the code base - #194
GH workflows only trigger for relevant parts of the code base#194douglowe wants to merge 4 commits into
Conversation
04f9a07 to
4284b61
Compare
There was a problem hiding this comment.
Pull request overview
This PR narrows when GitHub Actions workflows run on pull_request events by adding paths filters, aiming to trigger CI only when relevant parts of the repository change.
Changes:
- Added
on.pull_request.pathsfilters to unit tests, integration tests, and lint workflows. - Limited workflow triggers to changes under
app/**andtests/**.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/unit_tests.yml | Restricts unit test workflow triggers to app/** and tests/**. |
| .github/workflows/test_docker.yml | Restricts integration test workflow triggers to app/** and tests/**. |
| .github/workflows/lint.yml | Restricts lint workflow triggers to app/** and tests/**. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ensure that we check dependencies, docker build scripts, and docker compose files. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
alexhambley
left a comment
There was a problem hiding this comment.
This made me look at our CI coverage more broadly, and I'd like us to consider a few things before merging:
-
The workflows can't trigger themselves, so a PR that only touches
.github/workflows/(e.g., changing these filters, or bumping the Python version) would run no CI at all. I'd suggest adding.github/workflows/**to each list. -
We currently have no CI on merges. These workflows only run on
pull_request, so nothing runs when a PR reachesdevelop/main. This was OK before these changes, but with path filtering added on top, we need a push trigger as a safety net, e.g something like:
on:
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]
paths:
...Another thing (maybe for issue #193 rather than here): if we ever make these checks required, fltered workflows never report a status, so docs-only PRs for example would sit on "expected" forever.
The unit test, integration test, and code linting workflows only run on changes to the
appandtestsdirectories: