-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[CI] Skip tests on doc-only changes #25261
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
Conversation
.github/workflows/tests.yml
Outdated
!contains(github.event.head_commit.message, '[ci skip]') && | ||
!contains(github.event.head_commit.message, '[skip ci]') && | ||
!contains(github.event.head_commit.message, '[skip github]') && | ||
!contains(github.event.head_commit.message, '[ci doc]') |
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.
[ci doc]
should still be useful if you make a docstring only change. [skip github]
is specific to these tests, whereas GitHub’s [skip actions]
will skip all the GitHub actions. I don’t know whether that difference is important enough to keep [skip github]
(we don’t actually advertise it in the dev guide).
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.
Good point. I guess my thought is that anytime I have to explicitly opt-out of running CI by putting in a commit message I probably won't do that, so in general I was just trying to clean up the file a bit. But, we can leave these in too since they don't hurt anything.
Presumably tests will still run if you edit e.g. both an example and some mpl functionality? That doesn’t seem obvious from the GitHub docs. |
Yes, it should cover that case, with an example here:
|
# No need to test on documentation changes | ||
- 'doc/**' | ||
- 'examples/**' | ||
- 'tutorials/**' |
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.
Need to add plot_types. Note if we get #25209 in we can just test on "galleries/**"
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.
👍 We can add more later no problem. I guess an alternative question for the future is whether we really want these at the top-level of the repository versus living under doc/galleries
, doc/plot_types
etc... which would then allow just doc/**
to be ignored.
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.
We don't want to do that because then sphinx will try and process them and it will be confusing what the source and result of sphinx-gallery processing them is. However, getting them under one subdirectory at the top level is the goal of #25209
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.
Ahh, I see. I have not been following the docs reorganization. That does seem like a nice change!
I'll merge since there is no point in running CI on a CI change... |
PR Summary
We don't need to waste CI cycles for doc-only changes and having to remember to add
[doc skip]
to commit messages is asking a lot of users. Also removed extra CI conditionals for skipping that are already handled by GitHub: https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs(except [skip github], but that isn't documented and it should really be [skip actions], so let's just remove all of them).
I tested this on an example PR on my fork to verify: greglucas#21
I only added this to
pull_request:
, we could also add this topush:
, but it seems fine to run tests on every push tomain
regardless.PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst