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

Build PR branches only once (for origin branches) and skip docs changes #314

Merged
merged 3 commits into from
Apr 8, 2020

Conversation

joerick
Copy link
Contributor

@joerick joerick commented Apr 7, 2020

My PR branches get built twice on some CI services (Appveyor, Travis, Github), once for the PR and once for the branch. This disables the branch build, for anything other than master, to save some CI time.

Also, on services that support it, I've disabled docs changes from needing CI runs.

@Czaki
Copy link
Contributor

Czaki commented Apr 7, 2020

But I sometimes test in my own repository (development only on one system). So this configuration may introduce additional, obsolete PR.

@joerick
Copy link
Contributor Author

joerick commented Apr 7, 2020

But I sometimes test in my own repository (development only on one system). So this configuration may introduce additional, obsolete PR.

So you have your own CI services set up on your fork?

@Czaki
Copy link
Contributor

Czaki commented Apr 7, 2020

So you have your own CI services set up on your fork?

yes. Github actions are enabled out of box based on .github/workflow directory.

EDIT:
For example In #307 I test subprocess.run on windows without shell on my own branch and base on result I found this bug with PATH ignore.

@joerick
Copy link
Contributor Author

joerick commented Apr 7, 2020

Okay, you'd have to enable those yourself by deleting this change if you have a branch that you want test on.

@YannickJadoul
Copy link
Member

And there isn't a way to ignore PRs coming from the same repo (rather than pushes to branches in the repo)?

@joerick
Copy link
Contributor Author

joerick commented Apr 7, 2020

I don't think so, but I had an idea- you could test your personal branches by raising a PR to your own fork's master branch, rather than upstream master

@Czaki
Copy link
Contributor

Czaki commented Apr 7, 2020

basing on https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif
https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions and https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context

In github workflow it maybe something like

jobs:
  test:
  if: github.repository != 'joerick/cibuildwheel' || github.ref == master || github.event_name == 'pull_request'

@joerick
Copy link
Contributor Author

joerick commented Apr 7, 2020

Ah, okay, I'll give that a shot.

@joerick joerick merged commit 2345cf2 into master Apr 8, 2020
@joerick joerick deleted the conserve-ci-on-origin-branches branch April 11, 2020 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants