Skip to content
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

Avoid running duplicated tests on PRs #574

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

juhoinkinen
Copy link
Member

The PR checks list is a bit cluttered by 6 unit test runs: tests for both push and pull_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 the push 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 adds workflow_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.)

@juhoinkinen juhoinkinen added this to the 0.57 milestone Feb 17, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 17, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #574 (88f4db8) into master (d0f84ae) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #574   +/-   ##
=======================================
  Coverage   99.47%   99.47%           
=======================================
  Files          84       84           
  Lines        5568     5568           
=======================================
  Hits         5539     5539           
  Misses         29       29           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0f84ae...88f4db8. Read the comment docs.

@osma
Copy link
Member

osma commented Feb 17, 2022

This is great!

@juhoinkinen juhoinkinen merged commit 6238fb2 into master Feb 17, 2022
@juhoinkinen juhoinkinen deleted the gh-actions-more-efficient-testing branch February 17, 2022 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants