ci: run the test, lint, tox and coverage checks on every pull request - #154
Merged
Merged
Conversation
The pull_request triggers of these four workflows had the same paths filter as their push triggers (Python files, pyproject.toml and the workflow itself). That caused two problems. A pull request that changes only CHANGELOG.md never ran the tests, so the changelog format check added in #153 (test_the_repository_changelog_can_be_released) did not run on it. A changelog entry without a bold summary would only have failed at release time. The same applied to pull requests that change only uv.lock or tox.ini. These checks also could not be made required before merging. A required check whose workflow is filtered out never reports, so the pull request would wait for it forever. The pull_request triggers now have no paths filter. The push triggers keep theirs, since master has already been checked through its pull requests. The slowest check is tox, at about four minutes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The
pull_requesttriggers oftest.yml,lint.yml,tox.ymlandcoverage.ymlhad the samepathsfilter as theirpushtriggers: Python files,pyproject.toml, and the workflow file itself. That caused two problems:CHANGELOG.mdnever ran the tests, sotest_the_repository_changelog_can_be_releaseddidn't check it. An entry without a bold summary would only have failed during the release. The same applied to pull requests that change onlyuv.lock(e.g. Renovate lock-file maintenance) ortox.ini.What changes
pull_requesttriggers of those four workflows no longer have apathsfilter.pushtriggers keep theirs, since master has already been checked through its pull requests.docs.ymlandrenovate-validate.ymlare unchanged.Cost
The slowest of these checks is tox, which takes about 4 minutes. Test, coverage and lint take about 1 minute each. The repository is public, so Actions minutes are free.
Follow-up
After this is merged, master can get a ruleset rule that requires these checks to pass before merging. That is a repository setting, not part of this PR. The release workflow pushes its release commit to master directly, so that rule needs a bypass for GitHub Actions. The existing "Protect master" ruleset blocks only deletion and force pushes, so it doesn't affect the release.
Verification
This pull request can't show the change working: each of the four workflows lists its own file in its
paths, so they would run on this pull request under the old filters too. The first pull request that touches only docs orCHANGELOG.mdafter the merge will show it:test,lint,toxandcoverageshould all run on it.The workflow files pass the pre-commit
check-yamlhook.