Skip to content

Commit

Permalink
dev: Trim back the overgrown CI jobs
Browse files Browse the repository at this point in the history
Running on push _and_ PRs is often redundant.  For PRs, we really care
about the putative merge of the PR branch, and that's what "on:
pull_request" tests.  We typically do not need push-level CI results for
PRs.  On the other hand, CI results for every push to master are nice to
have both as a safety backstop and for the linear chain of CI history it
produces (e.g. to debug the impact of external changes on our CI).

The primary downside I see is that you can no longer push without
opening a PR just to see what CI says, but I think that's an acceptable
tradeoff, especially now that draft PRs are a thing.  To mitigate this
downside, "on: workflow_dispatch" allows CI to be manually dispatched
for a specific branch/tag/commit if you _really_ don't want to open even
a draft PR.

Trimming unnecessary CI jobs reduces the time to completion for CI runs
(good for the dev loop) and reduces organization-level job queuing,
which can negatively impact the workflows of other repos.
  • Loading branch information
tsibley committed Jun 7, 2022
1 parent d12f5b5 commit fab709a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: CI

on:
- push
- pull_request
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
test-source:
Expand Down

1 comment on commit fab709a

@corneliusroemer
Copy link
Member

@corneliusroemer corneliusroemer commented on fab709a Dec 20, 2024

Choose a reason for hiding this comment

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

See nextstrain/ncov#1134 (comment) for an additional caveat not mentioned in the commit message here: when there are merge conflicts, PR CI doesn't run

Please sign in to comment.