ci: run tests intelligently based on changes between consecutive commits #9017
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are using dorny/path-filter GitHub action to see which files are changed in our CI.
There is a scenario where it is not optimized.
Current behavior
main
and again detects that a go file and some docs are changed so it runs all go testsSolution:
run on pushing to any branch.
This will allow using a
base
property to set the base as the current branch:github.ref
and will detect changes between consecutive commitsThis seems to work and is skipping other tests when only the .md file is changed
https://github.com/coder/coder/actions/workflows/ci.yaml?query=branch%3Amatifali%2Foptimize-ci
New Behavior
main
and it has some go and ts files changes. ci runs all go and ts tests.This can save us some ci minutes.