Avoid running duplicated tests on PRs #574
Merged
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.
The PR checks list is a bit cluttered by 6 unit test runs: tests for both
push
andpull_request
events on 3 Python versions, while testing on both events is (mostly) useless as they are (nearly) identical cases.On the
pull_request
event the tests are run on "as the PR was merged", so it is more meaningful case to test, and is needed also as thepush
event is not available from forks.Running tests on all
push
events, however, is not so useful. On pushes the workflow is usually needed to be run only when the target is master branch (typically when a PR is merged or a release is made).This changes the
push
event trigger to exclude other branches than master. Also addsworkflow_dispatch
trigger, which allows manually running the workflow for any branch, which may sometimes be wanted for branches without PR.(Based on this discussion, also to follow in future for possible improvements.)