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

Do not run workflows if only non-source-code files are changed #837

Closed
seisman opened this issue Feb 5, 2021 · 1 comment · Fixed by #839
Closed

Do not run workflows if only non-source-code files are changed #837

seisman opened this issue Feb 5, 2021 · 1 comment · Fixed by #839
Labels
enhancement Improving an existing feature maintenance Boring but important stuff for the core devs

Comments

@seisman
Copy link
Member

seisman commented Feb 5, 2021

Description of the desired feature

Sometimes, we make changes to plain text files (.md, .rst), without changing any source codes. We know that the changes won't break our tests, but the workflow still runs 9 jobs (Ubuntu/macOS/Windows + Python 3.7/3.8/3.9). It's a waste of CI resources. For example, #726, #802, and #836.

GitHub Actions actually can skip workflows based on the files that are changed,

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. Path filters are not evaluated for pushes to tags.

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

We may explore this to reduce our CI usages. IMHO, we can skip running workflows if only the following files are changes:

  • *.md
  • **/*.rst
  • doc/**
  • examples/** (?)

Note that, the documentation is still built by vercel, so documentation preview still works.

Are you willing to help implement and maintain this feature? Yes, but let's discuss it first and contributions are welcomed.

@seisman seisman added enhancement Improving an existing feature maintenance Boring but important stuff for the core devs labels Feb 5, 2021
@liamtoney
Copy link
Member

I think this makes a lot of sense.

seisman added a commit that referenced this issue Feb 6, 2021
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
sixy6e pushed a commit to sixy6e/pygmt that referenced this issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants