Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Feb 20, 2023
Merged

Conversation

greglucas
Copy link
Contributor

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 to push:, but it seems fine to run tests on every push to main regardless.

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

!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]')
Copy link
Member

@rcomer rcomer Feb 19, 2023

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).

Copy link
Contributor Author

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.

@rcomer
Copy link
Member

rcomer commented Feb 19, 2023

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.

@greglucas
Copy link
Contributor Author

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:

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-paths

When all the path names match patterns in paths-ignore, the workflow will not run. If any path names do not match patterns in paths-ignore, even if some path names match the patterns, the workflow will run.

# No need to test on documentation changes
- 'doc/**'
- 'examples/**'
- 'tutorials/**'
Copy link
Member

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/**"

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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!

@jklymak jklymak added the CI: testing CI configuration and testing label Feb 20, 2023
@jklymak
Copy link
Member

jklymak commented Feb 20, 2023

I'll merge since there is no point in running CI on a CI change...

@jklymak jklymak merged commit ad55758 into matplotlib:main Feb 20, 2023
@greglucas greglucas deleted the doc-skip branch February 20, 2023 16:53
@QuLogic QuLogic added this to the v3.8.0 milestone Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: testing CI configuration and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants