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

Skip workflows in PRs if only non-source-code files are changed #839

Merged
merged 2 commits into from
Feb 6, 2021

Conversation

seisman
Copy link
Member

@seisman seisman commented Feb 5, 2021

Description of proposed changes

Skip workflows in PRs if ONLY the following are changed:

- 'doc/**'
- '*.md'
- '*.json'
- 'README.rst'
- 'LICENSE.txt'

Any other changes (especially changes in pygmt/ and examples/) still trigger the workflows.

Notes:

  • examples/ directory is not excluded because some examples may pass on one OS but fail on another one.
  • the workflow is always triggered in the master branch even though only plaintext files are changed

Fixes #837.

Reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@seisman
Copy link
Member Author

seisman commented Feb 5, 2021

If I understand the documentation correctly, it should work. However, I can't test it.

@seisman seisman added the maintenance Boring but important stuff for the core devs label Feb 5, 2021
@seisman seisman added this to the 0.3.0 milestone Feb 5, 2021
@seisman seisman changed the title Skip workflows if only non-source-code files are changed Skip workflows in PRs if only non-source-code files are changed Feb 5, 2021
@seisman seisman requested a review from a team February 5, 2021 23:08
@seisman seisman marked this pull request as ready for review February 6, 2021 00:05
Comment on lines +10 to +15
paths-ignore:
- 'doc/**'
- '*.md'
- '*.json'
- 'README.rst'
- 'LICENSE.txt'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if a git commit updates any file that matches these patterns (doc/**, *.md, etc), that means the workflow won't run? I guess that's ok, as long as we don't commit changes to a *.py and *.md file at the same time, or make sure to trigger the test somehow by editing only a *.py file.

A problem is that someone with administrative privileges might be required to merge the commit if the 'required checks' are not triggered. But I guess that's ok.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if a git commit updates any file that matches these patterns (doc/**, *.md, etc), that means the workflow won't run?

No. This is what the documentation says:

When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths.

If we make changes to a *.py and a .md file, the workflow still runs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we make changes to a *.py and a .md file, the workflow still runs.

Ah ok, perfect!

@seisman seisman merged commit 63081b9 into master Feb 6, 2021
@seisman seisman deleted the skip-workflow branch February 6, 2021 01:39
weiji14 added a commit that referenced this pull request Feb 6, 2021
So that it runs on every Pull Request commit,
needed after change made in #839.
weiji14 added a commit that referenced this pull request Feb 6, 2021
So that it runs on every Pull Request commit,
needed after change made in #839.

* Quickfix some code style links in CONTRIBUTING.md
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…ingTools#839)

Skip workflows in PRs if **ONLY** the following are changed:

```
- 'doc/**'
- '*.md'
- '*.json'
- 'README.rst'
- 'LICENSE.txt'
```

Any other changes (especially changes in `pygmt/` and `examples/`) still trigger the workflows.

**Notes:**

- `examples/` directory is not excluded because some examples may pass on one OS but fail on another one.
- the workflow is always triggered in the master branch even though only plaintext files are changed

Fixes GenericMappingTools#837.

Reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…#849)

So that it runs on every Pull Request commit,
needed after change made in GenericMappingTools#839.

* Quickfix some code style links in CONTRIBUTING.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not run workflows if only non-source-code files are changed
2 participants