-
Notifications
You must be signed in to change notification settings - Fork 88
ci: refine workflow triggers with detailed path-based filtering #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…oy, lint, and test workflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds path-based filtering to GitHub Actions workflows to optimize CI/CD resource usage by ensuring workflows only run when relevant files change. The changes affect four workflow files: build-docker-images.yml, deploy.yml, pylint.yml, and test.yml.
Key Changes:
- Added
pathsfilters to push and pull_request triggers across multiple workflows to restrict when they execute - Modified deploy.yml to use path-based push triggers instead of workflow_run dependency
- Added granular path patterns targeting source code, configuration files, Docker files, and workflow files themselves
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .github/workflows/test.yml | Added path filters for backend Python files, tests, requirements, and workflow file to push and pull_request triggers |
| .github/workflows/pylint.yml | Added path filters for Python files, requirements, pyproject.toml, .flake8 config, and workflow file; added pull_request trigger with same filters |
| .github/workflows/deploy.yml | Replaced workflow_run trigger with path-filtered push trigger for infrastructure and deployment-related files |
| .github/workflows/build-docker-images.yml | Added path filters for backend, frontend, docker directories, and workflow files to push and pull_request triggers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| paths: | ||
| - 'src/backend/**/*.py' | ||
| - 'src/tests/backend/**' | ||
| - '.github/workflows/test.yml' | ||
| - 'src/backend/requirements.txt' | ||
| - 'src/backend/pyproject.toml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path filter is missing 'src/frontend/requirements.txt'. Looking at line 90 of this workflow, the test job installs dependencies from 'src/frontend/requirements.txt', so changes to that file should trigger the workflow to ensure tests run with updated frontend dependencies.
| paths: | ||
| - 'src/backend/**/*.py' | ||
| - 'src/tests/backend/**' | ||
| - '.github/workflows/test.yml' | ||
| - 'src/backend/requirements.txt' | ||
| - 'src/backend/pyproject.toml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path filter is missing 'src/frontend/requirements.txt'. Looking at line 90 of this workflow, the test job installs dependencies from 'src/frontend/requirements.txt', so changes to that file should trigger the workflow to ensure tests run with updated frontend dependencies.
Purpose
This pull request updates several GitHub Actions workflow files to add more granular path filtering and improve when workflows are triggered. The main goal is to ensure that workflows only run when relevant files are changed, which helps optimize CI/CD resources and reduces unnecessary workflow runs.
Key changes by workflow:
Build and Docker workflows:
.github/workflows/build-docker-images.ymlto includepathsfilters for bothpushandpull_requestevents, so the workflow only runs when files insrc/backend,src/frontend,docker, or the workflow files themselves are modified. [1] [2]Deploy workflow:
.github/workflows/deploy.ymlto trigger onpushandpull_requestevents affectinginfra,scripts,azure.yaml, or the workflow file itself, instead of only on completion of another workflow. Also, added specific pull request event types for finer control.Linting workflow:
.github/workflows/pylint.ymlto run only when Python files, requirements, or related config files are changed, for bothpushandpull_requestevents.Testing workflow:
pathsfilters to.github/workflows/test.ymlso it only runs on changes to backend Python files, backend tests, requirements, or the workflow file itself, for bothpushandpull_requestevents. [1] [2]Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information