From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>,
Jeff Hostetler <jeffhost@microsoft.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH] ci: respect the [skip ci] convention in our GitHub workflow "CI/PR"
Date: Sat, 02 May 2020 15:08:07 +0000 [thread overview]
Message-ID: <pull.776.git.git.1588432087854.gitgitgadget@gmail.com> (raw)
From: Johannes Schindelin <johannes.schindelin@gmx.de>
It might have been invented by Travis CI (at least it is described here:
https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build)
to avoid unnecessary builds: if the tip commit message (or for PR
builds, the PR description) contains the needle `[skip ci]`, then the
build is skipped.
Unlike Azure Pipelines, GitHub workflows does not support that feature
out of the box (at least not at the time of writing), but we can
reinstate it manually.
Note: GitHub workflows might implement this at some stage. In the least,
the desire for this feature is expressed, together with some history, at
https://github.community/t5/GitHub-Actions/GitHub-Actions-does-not-respect-skip-ci/m-p/42834
While it is the number five in the kudo ranking of the GitHub Actions
posts, it might take a while given the current state of the world. In
the meantime let's do the manual thing.
Following Travis CI's example, we also add special handling to exclude
the PR build when the PR title or description (or any other part of the
pull request information provided by the GitHub event) contains the
needle `[skip pr]`.
Note: for technical reasons, a PR build will still run if a commit
message contains the needle `[skip ci]` but neither PR title nor
description contain the needle `[skip pr]`: for PR builds, the commit
messages are not part of the payload delivered via the event.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
ci: allow skipping CI/PR builds on GitHub
It was mentioned to me that it might not be totally helpful to run all
the builds whenever an in-progress branch is pushed to GitHub. For
example, if a contributor has dozens of topic branches in flight, they
might not want to have all of them built whenever a new end-of-day push
happens.
This patch tries to address that, by following the convention that I
believe Travis CI invented: if a commit message contains the needle
[skip ci], any CI build (i.e. a build triggered by a push) is skipped.
Likewise, PR builds are skipped when the PR title and/or description
contains [skip pr].
Ideally, GitHub workflows will support this feature at some stage, but
until then, we could have this (admittedly not very elegant) workaround.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-776%2Fdscho%2Fskip-ci-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-776/dscho/skip-ci-v1
Pull-Request: https://github.com/git/git/pull/776
.github/workflows/main.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index fd4df939b50..0e4a280d309 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,6 +7,7 @@ env:
jobs:
windows-build:
+ if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]') && !contains(toJSON(github.event.pull_request), '[skip pr]')"
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
@@ -70,6 +71,7 @@ jobs:
name: failed-tests-windows
path: ${{env.FAILED_TEST_ARTIFACTS}}
vs-build:
+ if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]') && !contains(toJSON(github.event.pull_request), '[skip pr]')"
env:
MSYSTEM: MINGW64
NO_PERL: 1
@@ -154,6 +156,7 @@ jobs:
${{matrix.nr}} 10 t[0-9]*.sh)
"@
regular:
+ if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]') && !contains(toJSON(github.event.pull_request), '[skip pr]')"
strategy:
matrix:
vector:
@@ -189,6 +192,7 @@ jobs:
name: failed-tests-${{matrix.vector.jobname}}
path: ${{env.FAILED_TEST_ARTIFACTS}}
dockerized:
+ if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]') && !contains(toJSON(github.event.pull_request), '[skip pr]')"
strategy:
matrix:
vector:
@@ -213,6 +217,7 @@ jobs:
name: failed-tests-${{matrix.vector.jobname}}
path: ${{env.FAILED_TEST_ARTIFACTS}}
static-analysis:
+ if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]') && !contains(toJSON(github.event.pull_request), '[skip pr]')"
env:
jobname: StaticAnalysis
runs-on: ubuntu-latest
@@ -221,6 +226,7 @@ jobs:
- run: ci/install-dependencies.sh
- run: ci/run-static-analysis.sh
documentation:
+ if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]') && !contains(toJSON(github.event.pull_request), '[skip pr]')"
env:
jobname: Documentation
runs-on: ubuntu-latest
base-commit: b34789c0b0d3b137f0bb516b417bd8d75e0cb306
--
gitgitgadget
next reply other threads:[~2020-05-02 15:11 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-02 15:08 Johannes Schindelin via GitGitGadget [this message]
2020-05-03 9:36 ` [PATCH] ci: respect the [skip ci] convention in our GitHub workflow "CI/PR" Jeff King
2020-05-03 12:05 ` Danh Doan
2020-05-04 15:01 ` Jeff King
2020-05-04 15:49 ` [PATCH v2 0/2] Limit GitHub Actions to designated branches Đoàn Trần Công Danh
2020-05-04 15:49 ` [PATCH v2 1/2] CI: limit " Đoàn Trần Công Danh
2020-05-04 16:23 ` Jeff King
2020-05-04 21:58 ` Taylor Blau
2020-05-04 22:52 ` Junio C Hamano
2020-05-04 23:15 ` Taylor Blau
2020-05-04 23:35 ` Jeff King
2020-05-05 0:24 ` Junio C Hamano
2020-05-04 23:36 ` Jeff King
2020-05-05 0:20 ` Taylor Blau
2020-05-05 16:43 ` Jeff King
2020-05-05 17:57 ` Junio C Hamano
2020-05-05 18:24 ` Jeff King
2020-05-05 21:04 ` Jeff King
2020-05-05 21:29 ` Junio C Hamano
2020-05-05 21:58 ` Jeff King
2020-05-05 22:28 ` Junio C Hamano
2020-05-06 15:09 ` Johannes Schindelin
2020-05-06 16:26 ` Junio C Hamano
2020-05-07 12:17 ` Jeff King
2020-05-07 14:02 ` Jeff King
2020-05-07 18:17 ` Junio C Hamano
2020-05-07 12:01 ` Đoàn Trần Công Danh
2020-05-07 12:47 ` Đoàn Trần Công Danh
2020-05-06 0:46 ` Đoàn Trần Công Danh
2020-05-06 3:56 ` Junio C Hamano
2020-05-06 14:25 ` Đoàn Trần Công Danh
2020-05-06 16:31 ` Junio C Hamano
2020-05-07 12:25 ` Jeff King
2020-05-07 18:29 ` Junio C Hamano
2020-05-07 18:54 ` Jeff King
2020-05-07 19:33 ` Junio C Hamano
2020-05-07 16:20 ` [PATCH v2] ci: allow per-branch config for GitHub Actions Jeff King
2020-05-07 17:00 ` Taylor Blau
2020-05-07 17:18 ` Jeff King
2020-05-07 19:53 ` Junio C Hamano
2020-05-07 20:46 ` Jeff King
2020-05-07 21:58 ` Junio C Hamano
2020-05-08 18:00 ` Jeff King
2020-05-09 1:23 ` Đoàn Trần Công Danh
2020-05-05 0:34 ` [PATCH v2 1/2] CI: limit GitHub Actions to designated branches Đoàn Trần Công Danh
2020-05-04 15:49 ` [PATCH v2 2/2] SubmittingPatches: advertise GitHub Actions CI Đoàn Trần Công Danh
2020-05-04 16:37 ` Junio C Hamano
2020-05-05 0:46 ` Đoàn Trần Công Danh
2020-05-05 16:26 ` [PATCH v3 0/3] Provide option to opt in/out GitHub Actions Đoàn Trần Công Danh
2020-05-05 16:26 ` [PATCH v3 1/3] SubmittingPatches: advertise GitHub Actions CI Đoàn Trần Công Danh
2020-05-05 16:47 ` Jeff King
2020-05-05 16:59 ` Đoàn Trần Công Danh
2020-05-05 17:07 ` Jeff King
2020-05-05 16:26 ` [PATCH v3 2/3] CI: limit GitHub Actions to designated branches Đoàn Trần Công Danh
2020-05-05 16:51 ` Jeff King
2020-05-05 17:05 ` Đoàn Trần Công Danh
2020-05-05 17:11 ` Jeff King
2020-05-05 18:49 ` Junio C Hamano
2020-05-05 16:26 ` [PATCH v3 3/3] fixup! " Đoàn Trần Công Danh
2020-05-05 18:59 ` Junio C Hamano
2020-05-05 17:01 ` [PATCH v3 0/3] Provide option to opt in/out GitHub Actions Jeff King
2020-05-03 16:46 ` [PATCH] ci: respect the [skip ci] convention in our GitHub workflow "CI/PR" Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.776.git.git.1588432087854.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=jeffhost@microsoft.com \
--cc=johannes.schindelin@gmx.de \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).