Skip to content

Only run CI on pushes to main/master and pull requests #7883

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
May 20, 2022

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented May 19, 2022

Currently, when a maintainer opens a pull request from a branch in the
typeshed repository (instead of a fork), CI is run twice: once for the
PR and once for the push. This not only wastes CI minutes (and it seems
we're running into some limits lately), but also makes CI output twice
as large and more difficult to process.

The disadvantage is that a PR needs to be opened to run CI.
Alternatively, CI can be triggered manually.

Currently, when a maintainer opens a pull request from a branch in the
typeshed repository (instead of a fork), CI is run twice: once for the
PR and once for the push. This not only wastes CI minutes (and it seems
we're running into some limits lately), but also makes CI output twice
as large and more difficult to process.

The disadvantage is that a PR needs to be opened to run CI.
Alternatively, CI can be triggered manually.
@srittau
Copy link
Collaborator Author

srittau commented May 19, 2022

Example: #7882

@AlexWaygood
Copy link
Member

AlexWaygood commented May 19, 2022

Alternatively, CI can be triggered manually.

Oh, how do you do that? I wasn't aware (and I've found it useful in the past to run CI on a branch, prior to opening a PR, though it's not my normal workflow).

As well as this, we can also consider only running stubtest_stdlib.py on PRs that touch the stdlib, tests.yml, and/or tests/stdlib.py itself.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood
Copy link
Member

Oh, how do you do that?

Instructions here, for future reference: https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow.

It's pretty easy, so I'm fine with this change.

Copy link
Collaborator

@Akuli Akuli left a comment

Choose a reason for hiding this comment

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

In the past, I have used a similar configuration in other projects, and it works well. Just one nit.

@@ -3,6 +3,9 @@ name: Test
on:
workflow_dispatch:
push:
branches:
- main
Copy link
Collaborator

Choose a reason for hiding this comment

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

We currently don't have a main branch, so this is redundant. If we some day decide to rename master to main, we'll have to grep for master anyway.

@srittau srittau merged commit adf48f1 into python:master May 20, 2022
@srittau srittau deleted the ci-fix branch May 20, 2022 12:14
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