-
Notifications
You must be signed in to change notification settings - Fork 224
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
Run tests in a single CI job (Ubuntu + Python 3.9) for draft PRs #906
Conversation
This PR makes changes to save CI resources: - For draft PRs: only run tests on Ubuntu + Python 3.9 (~10 minutes) - When draft PRs are ready for review, run all CI jobs (9 jobs, 10-30 minutes) - If converting PRs back to draft mode, pushes still only trigger one job
Now, this PR is in draft mode. As expected, commit af67396 only triggers one job (Ubuntu + Python 3.9). Check https://github.com/GenericMappingTools/pygmt/actions/runs/570286139 for the job details. Below is the screenshot of the CI runs. Only the "ubuntu-latest - Python 3.9" job is triggered. Other jobs are waiting for status because they're not triggered. |
This PR is still in draft mode. New commits like 7c6309d still only triggers one job (ubuntu-latest - Python 3.9). Check https://github.com/GenericMappingTools/pygmt/actions/runs/570313438 for job details. Here is the screenshot of the CI runs. Only one is running (in progress). |
I just pushed the "Ready for Review" button, which triggers all the CI jobs. Check https://github.com/GenericMappingTools/pygmt/actions/runs/570319849 for job details. Below is the screenshot for job status. Some notes:
|
The PR is not in draft mode, so new commits like 4dc7e87 trigger new CI runs (9 jobs). Check https://github.com/GenericMappingTools/pygmt/actions/runs/570349410 for job details. Some notes:
|
PR authors and project maintainers can convert a PR into draft mode. Note that "convert to draft" is not an "event", so it doesn't trigger new CI runs. |
Now the PR is in draft mode. New commits like 06d0073 only triggers one job (ubuntu-latest + Python 3.9). Check https://github.com/GenericMappingTools/pygmt/actions/runs/570386483 for job details. |
Now I can make more changes in draft mode. Each commit only triggers one job, so saving us 8/9 CI resources, especially for macOS and Windows. Like above, if I mark the PR as ready for review again, 9 jobs will be triggered. So what will happen if the changes are merged into master branch? I can't show you in this repository. Instead, I made similar changes to my own fork (https://github.com/seisman/pygmt), and merge the changes into my master branch. Everything works well. See the screenshot below and https://github.com/seisman/pygmt/actions/runs/570241183 for job details. The "Publish to PyPI" workflow fails as reported in #901. |
Now this PR is ready for review. |
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.
This is awesome, now I won't feel so bad burning through so many CPU cycles! Just a few comments.
Co-authored-by: Wei Ji <[email protected]>
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.
Up to you if you want to apply the changes below to close #908, otherwise good to merge.
In draft Pull Requests, only one job (Ubuntu + Python latest) | ||
is triggered to save on Continuous Integration resources. |
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.
In draft Pull Requests, only one job (Ubuntu + Python latest) | |
is triggered to save on Continuous Integration resources. | |
To save on Continuous Integration resources, keep your Pull Request | |
in draft mode so that only one job (Ubuntu + Python latest) is triggered. |
@@ -58,6 +58,8 @@ It is also scheduled to run daily on the *master* branch. | |||
|
|||
This is ran on every commit to the *master* and Pull Request branches. | |||
It is also scheduled to run daily on the *master* branch. | |||
In draft Pull Requests, only one job (Ubuntu + Python latest) | |||
is triggered to save on Continuous Integration resources. | |||
|
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.
Alternatively, add [skip ci] to your commit message so that Github Actions won't run. | |
See https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/. | |
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.
Prefer to leave it to another PR, as more tests need to be done before documenting it.
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.
Ok, feel free to copy this text to that next PR.
…enericMappingTools#906) This PR improves the "Tests" workflow to save CI resources: - For draft PRs: only run tests on Ubuntu + Python 3.9 (~10 minutes) - When draft PRs are ready for review, run all CI jobs (9 jobs, 10-30 minutes) - If converting PRs back to draft mode, pushes still only trigger one job (~10 minutes) - After merged into master, all 9 jobs will run. * Update MAINTENANCE.md Co-authored-by: Wei Ji <[email protected]>
Description of proposed changes
This PR is inspired by another PR #869 from @willschlitzer.
This PR improves the "Tests" workflow to save CI resources.
Expected behavior (see the comments below for how it actually works):
References:
Closes #869.