diff mbox series

[v3,3/3] fixup! CI: limit GitHub Actions to designated branches

Message ID a2e548b683cd584fd686a44e1d7f3473943fc73f.1588695295.git.congdanhqx@gmail.com (mailing list archive)
State New, archived
Headers show
Series Provide option to opt in/out GitHub Actions | expand

Commit Message

Đoàn Trần Công Danh May 5, 2020, 4:26 p.m. UTC
Here is the patch to for discussion.

Should we want to enable GitHub Action for all repo-s, except git/git
and gitster/git. We'll want to have this patch fix-up to the previous
one.

With this patch merged, contributors will need to opt-out by push to
a branch/tag with "wip" anywhere in the refname.

Note that, integration branches (maint, master, next, jch, pu) will
always be built, regardless of repo.
Since the current condition is ugly enough, and I find it's very hard to
wrap my head around those condition.

Should this patch get fixing up into previous one, please remove the second
paragraph in the body of previous patch.

Thanks.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 .github/workflows/main.yml      | 80 ++++++++++++++++++++++++++++++---
 Documentation/SubmittingPatches |  4 +-
 2 files changed, 76 insertions(+), 8 deletions(-)

Comments

Junio C Hamano May 5, 2020, 6:59 p.m. UTC | #1
Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:

> Should we want to enable GitHub Action for all repo-s, except git/git
> and gitster/git. We'll want to have this patch fix-up to the previous
> one.

Just to get everybody on the same page,

	git/git has only the primary integration branches and tags
	gitster/git has broken out individual topics

We do want to build everything in git/git repository.

I do not have Actions enabled for gitster/git repository.

I expect general contributors to fork from the former, push their
work on their own branches (not the copies of the public integration
branches like 'master', 'next', etc.) so that they can throw a pull
request at git/git.

>  jobs:
>    windows-build:
> +    if: >-
> +      ${{
> +      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
> +      github.ref == 'refs/heads/maint' ||
> +      github.ref == 'refs/heads/master' ||
> +      github.ref == 'refs/heads/next' ||
> +      github.ref == 'refs/heads/jch' ||
> +      github.ref == 'refs/heads/pu'
> +      }}

Ialready asked not to make this about me.  You do not want to search
and replace 'gitster' with 'peff' or 'dscho' or whatever string,
only because/when I chose to retire.  Such an occasion shouldn't be
a significant event to the project's codebase.

Thanks.
diff mbox series

Patch

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9bba0ce068..81dfa3d228 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,12 +4,8 @@  on:
   pull_request:
   push:
     branches:
-      - maint
-      - master
-      - next
-      - jch
-      - pu
-      - 'for-ci**'
+      - '**'
+      - '!**wip**'
     tags:
       - '**'
       - '!**wip**'
@@ -19,6 +15,15 @@  env:
 
 jobs:
   windows-build:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     runs-on: windows-latest
     steps:
     - uses: actions/checkout@v1
@@ -43,6 +48,15 @@  jobs:
         name: windows-artifacts
         path: artifacts
   windows-test:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     runs-on: windows-latest
     needs: [windows-build]
     strategy:
@@ -82,6 +96,15 @@  jobs:
         name: failed-tests-windows
         path: ${{env.FAILED_TEST_ARTIFACTS}}
   vs-build:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     env:
       MSYSTEM: MINGW64
       NO_PERL: 1
@@ -130,6 +153,15 @@  jobs:
         name: vs-artifacts
         path: artifacts
   vs-test:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     runs-on: windows-latest
     needs: [vs-build]
     strategy:
@@ -166,6 +198,15 @@  jobs:
                           ${{matrix.nr}} 10 t[0-9]*.sh)
         "@
   regular:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     strategy:
       matrix:
         vector:
@@ -201,6 +242,15 @@  jobs:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}
   dockerized:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     strategy:
       matrix:
         vector:
@@ -225,6 +275,15 @@  jobs:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}
   static-analysis:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     env:
       jobname: StaticAnalysis
     runs-on: ubuntu-latest
@@ -233,6 +292,15 @@  jobs:
     - run: ci/install-dependencies.sh
     - run: ci/run-static-analysis.sh
   documentation:
+    if: >-
+      ${{
+      (github.repository_owner != 'git' && github.repository_owner != 'gitster') ||
+      github.ref == 'refs/heads/maint' ||
+      github.ref == 'refs/heads/master' ||
+      github.ref == 'refs/heads/next' ||
+      github.ref == 'refs/heads/jch' ||
+      github.ref == 'refs/heads/pu'
+      }}
     env:
       jobname: Documentation
     runs-on: ubuntu-latest
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index e516b080df..a2e6a3d2ca 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -79,8 +79,8 @@  test your changes on Linux, Mac (and hopefully soon Windows).  See
 GitHub-Travis CI hints section for details.
 
 Alternately, you can use GitHub Actions (which supports testing your changes
-on Linux, macOS, and Windows) by pushing into a branch whose name starts
-with "for-ci", or a tag whose name doesn't have `wip`,
+on Linux, macOS, and Windows) by pushing into a branch or tag
+whose name doesn't have `wip`,
 or opening a GitHub's Pull Request against
 https://github.com/git/git.git or a fork of that repository.