git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: git@vger.kernel.org
Cc: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>
Subject: [PATCH v5 07/12] ci: configure GitHub Actions for CI/PR
Date: Sat, 11 Apr 2020 00:18:09 +0700	[thread overview]
Message-ID: <40fe4f7e2c34c6997a6824ef0dc6aad7a71a4434.1586538752.git.congdanhqx@gmail.com> (raw)
In-Reply-To: <cover.1586538752.git.congdanhqx@gmail.com>

This patch adds CI builds via GitHub Actions. While the underlying
technology is at least _very_ similar to that of Azure Pipelines, GitHub
Actions are much easier to set up than Azure Pipelines:

- no need to install a GitHub App,

- no need to set up an Azure DevOps account,

- all you need to do is push to your fork on GitHub.

Therefore, it makes a lot of sense for us to have a working GitHub
Actions setup.

While copy/editing `azure-pipelines.yml` into
`.github/workflows/main.yml`, we also use the opportunity to accelerate
the step that sets up a minimal subset of Git for Windows' SDK in the
Windows-build job:

- we now download a `.tar.xz` stored in Azure Blobs and extract it
  simultaneously by calling `curl` and piping the result to `tar`,

- decompressing via `xz`,

- all three utilities are installed together with Git for Windows

At the same time, we also make use of the matrix build feature, which
reduces the amount of repeated text by quite a bit.

Also, we do away with the parts that try to mount a file share on which
`prove` can store data between runs. It is just too complicated to set
up, and most times the tree changes anyway, so there is little return on
investment there.

Initial-patch-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 .github/workflows/main.yml | 212 +++++++++++++++++++++++++++++++++++++
 1 file changed, 212 insertions(+)
 create mode 100644 .github/workflows/main.yml

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000000..e1ac6d23b4
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,212 @@
+name: CI/PR
+
+on: [push, pull_request]
+
+env:
+  DEVELOPER: 1
+
+jobs:
+  windows-build:
+    runs-on: windows-latest
+    steps:
+    - uses: actions/checkout@v1
+    - name: download git-sdk-64-minimal
+      shell: bash
+      run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
+    - name: build
+      shell: powershell
+      env:
+        HOME: ${{runner.workspace}}
+        MSYSTEM: MINGW64
+        NO_PERL: 1
+      run: |
+        & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
+        printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
+
+          ci/make-test-artifacts.sh artifacts
+        "@
+    - name: upload build artifacts
+      uses: actions/upload-artifact@v1
+      with:
+        name: windows-artifacts
+        path: artifacts
+  windows-test:
+    runs-on: windows-latest
+    needs: [windows-build]
+    strategy:
+      matrix:
+        nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+    steps:
+    - uses: actions/checkout@v1
+    - name: download git-sdk-64-minimal
+      shell: bash
+      run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
+    - name: download build artifacts
+      uses: actions/download-artifact@v1
+      with:
+        name: windows-artifacts
+        path: ${{github.workspace}}
+    - name: extract build artifacts
+      shell: bash
+      run: tar xf artifacts.tar.gz
+    - name: test
+      shell: powershell
+      run: |
+        & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
+          # Let Git ignore the SDK
+          printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
+
+          ci/run-test-slice.sh ${{matrix.nr}} 10
+        "@
+    - name: ci/print-test-failures.sh
+      if: failure()
+      shell: powershell
+      run: |
+        & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
+  vs-build:
+    env:
+      MSYSTEM: MINGW64
+      NO_PERL: 1
+      GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
+    runs-on: windows-latest
+    steps:
+    - uses: actions/checkout@v1
+    - name: download git-sdk-64-minimal
+      shell: bash
+      run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
+    - name: generate Visual Studio solution
+      shell: powershell
+      run: |
+        & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
+          make NDEBUG=1 DEVELOPER=1 vcxproj
+        "@
+        if (!$?) { exit(1) }
+    - name: download vcpkg artifacts
+      shell: powershell
+      run: |
+        $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
+        $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
+        $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
+        (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
+        Expand-Archive compat.zip -DestinationPath . -Force
+        Remove-Item compat.zip
+    - name: add msbuild to PATH
+      uses: microsoft/setup-msbuild@v1.0.0
+    - name: MSBuild
+      run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
+    - name: bundle artifact tar
+      shell: powershell
+      env:
+        MSVC: 1
+        VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
+      run: |
+        & compat\vcbuild\vcpkg_copy_dlls.bat release
+        if (!$?) { exit(1) }
+        & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
+          mkdir -p artifacts &&
+          eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
+        "@
+    - name: upload build artifacts
+      uses: actions/upload-artifact@v1
+      with:
+        name: vs-artifacts
+        path: artifacts
+  vs-test:
+    runs-on: windows-latest
+    needs: [vs-build]
+    strategy:
+      matrix:
+        nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+    steps:
+    - uses: actions/checkout@v1
+    - name: download git-64-portable
+      shell: bash
+      run: a=git-64-portable && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
+    - name: download build artifacts
+      uses: actions/download-artifact@v1
+      with:
+        name: vs-artifacts
+        path: ${{github.workspace}}
+    - name: extract build artifacts
+      shell: bash
+      run: tar xf artifacts.tar.gz
+    - name: test (parallel)
+      shell: powershell
+      env:
+        MSYSTEM: MINGW64
+        NO_SVN_TESTS: 1
+        GIT_TEST_SKIP_REBASE_P: 1
+      run: |
+        & git-64-portable\git-cmd.exe --command=usr\bin\bash.exe -lc @"
+          # Let Git ignore the SDK and the test-cache
+          printf '%s\n' /git-64-portable/ /test-cache/ >>.git/info/exclude
+
+          cd t &&
+          PATH=\"`$PWD/helper:`$PATH\" &&
+          test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
+                  `$(test-tool.exe path-utils slice-tests \
+                          ${{matrix.nr}} 10 t[0-9]*.sh)
+        "@
+  regular:
+    strategy:
+      matrix:
+        vector:
+          - jobname: linux-clang
+            cc: clang
+            pool: ubuntu-latest
+          - jobname: linux-gcc
+            cc: gcc
+            pool: ubuntu-latest
+          - jobname: osx-clang
+            cc: clang
+            pool: macos-latest
+          - jobname: osx-gcc
+            cc: gcc
+            pool: macos-latest
+          - jobname: GETTEXT_POISON
+            cc: gcc
+            pool: ubuntu-latest
+    env:
+      CC: ${{matrix.vector.cc}}
+      jobname: ${{matrix.vector.jobname}}
+    runs-on: ${{matrix.vector.pool}}
+    steps:
+    - uses: actions/checkout@v1
+    - run: ci/install-dependencies.sh
+    - run: ci/run-build-and-tests.sh
+    - run: ci/print-test-failures.sh
+      if: failure()
+  dockerized:
+    strategy:
+      matrix:
+        vector:
+        - jobname: linux-musl
+          image: alpine
+        - jobname: Linux32
+          image: daald/ubuntu32:xenial
+    env:
+      jobname: ${{matrix.vector.jobname}}
+    runs-on: ubuntu-latest
+    container: ${{matrix.vector.image}}
+    steps:
+    - uses: actions/checkout@v1
+    - run: ci/install-docker-dependencies.sh
+    - run: ci/run-build-and-tests.sh
+    - run: ci/print-test-failures.sh
+      if: failure()
+  static-analysis:
+    env:
+      jobname: StaticAnalysis
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v1
+    - run: ci/install-dependencies.sh
+    - run: ci/run-static-analysis.sh
+  documentation:
+    env:
+      jobname: Documentation
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v1
+    - run: ci/install-dependencies.sh
+    - run: ci/test-documentation.sh
-- 
2.26.0.334.g6536db25bb


  parent reply	other threads:[~2020-04-10 17:18 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 12:48 [PATCH 0/5] ci: replace our Azure Pipeline by GitHub Actions Johannes Schindelin via GitGitGadget
2020-03-31 12:48 ` [PATCH 1/5] ci/lib: if CI type is unknown, show the environment variables Johannes Schindelin via GitGitGadget
2020-03-31 12:48 ` [PATCH 2/5] ci/lib: allow running in GitHub Actions Johannes Schindelin via GitGitGadget
2020-04-03  8:46   ` SZEDER Gábor
2020-04-04 20:08     ` Johannes Schindelin
2020-04-05  0:01       ` Danh Doan
2020-04-07 22:41         ` Johannes Schindelin
2020-04-10 15:31       ` SZEDER Gábor
2020-04-10 19:10         ` Junio C Hamano
2020-04-12 21:42           ` Johannes Schindelin
2020-04-12 22:12             ` Junio C Hamano
2020-04-12 22:25               ` Junio C Hamano
2020-03-31 12:48 ` [PATCH 3/5] ci: configure GitHub Actions for CI/PR Johannes Schindelin via GitGitGadget
2020-04-03 22:07   ` SZEDER Gábor
2020-04-04 17:59     ` Johannes Schindelin
2020-04-04 23:55       ` Danh Doan
2020-03-31 12:48 ` [PATCH 4/5] README: add a build badge for the GitHub Actions runs Johannes Schindelin via GitGitGadget
2020-03-31 12:48 ` [PATCH 5/5] ci: retire the Azure Pipelines definition Johannes Schindelin via GitGitGadget
2020-03-31 14:46 ` [PATCH 0/5] ci: replace our Azure Pipeline by GitHub Actions Danh Doan
2020-03-31 18:47   ` Junio C Hamano
2020-04-01 15:55 ` [PATCH v2 0/6] " Đoàn Trần Công Danh
2020-04-01 15:55   ` [PATCH v2 1/6] ci/lib: if CI type is unknown, show the environment variables Đoàn Trần Công Danh
2020-04-01 15:55   ` [PATCH v2 2/6] ci/lib: allow running in GitHub Actions Đoàn Trần Công Danh
2020-04-01 15:55   ` [PATCH v2 3/6] ci/lib: set TERM environment variable if not exist Đoàn Trần Công Danh
2020-04-01 15:55   ` [PATCH v2 4/6] ci: configure GitHub Actions for CI/PR Đoàn Trần Công Danh
2020-04-01 15:55   ` [PATCH v2 5/6] README: add a build badge for the GitHub Actions runs Đoàn Trần Công Danh
2020-04-01 15:55   ` [PATCH v2 6/6] ci: retire the Azure Pipelines definition Đoàn Trần Công Danh
2020-04-01 21:23   ` [PATCH v2 0/6] ci: replace our Azure Pipeline by GitHub Actions Junio C Hamano
2020-04-02  0:14     ` Danh Doan
2020-04-02 13:16   ` [PATCH v3 " Đoàn Trần Công Danh
2020-04-02 13:16     ` [PATCH v3 1/6] ci/lib: if CI type is unknown, show the environment variables Đoàn Trần Công Danh
2020-04-02 13:16     ` [PATCH v3 2/6] ci/lib: allow running in GitHub Actions Đoàn Trần Công Danh
2020-04-02 13:16     ` [PATCH v3 3/6] ci/lib: set TERM environment variable if not exist Đoàn Trần Công Danh
2020-04-02 13:16     ` [PATCH v3 4/6] ci: configure GitHub Actions for CI/PR Đoàn Trần Công Danh
2020-04-02 13:16     ` [PATCH v3 5/6] README: add a build badge for the GitHub Actions runs Đoàn Trần Công Danh
2020-04-02 13:17     ` [PATCH v3 6/6] ci: retire the Azure Pipelines definition Đoàn Trần Công Danh
2020-04-08  4:05 ` [PATCH v4 00/12] ci: replace our Azure Pipeline by GitHub Actions Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 01/12] ci/lib: if CI type is unknown, show the environment variables Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 02/12] ci/lib: allow running in GitHub Actions Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 03/12] ci/lib: set TERM environment variable if not exist Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 04/12] ci: fix the `jobname` of the `GETTEXT_POISON` job Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 05/12] ci: explicit install all required packages Đoàn Trần Công Danh
2020-04-10 15:53     ` SZEDER Gábor
2020-04-10 16:07       ` Danh Doan
2020-04-10 16:21         ` Junio C Hamano
2020-04-08  4:05   ` [PATCH v4 06/12] ci: run gem with sudo to install asciidoctor Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 07/12] ci: configure GitHub Actions for CI/PR Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 08/12] README: add a build badge for the GitHub Actions runs Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 09/12] ci: retire the Azure Pipelines definition Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 10/12] tests: when run in Bash, annotate test failures with file name/line number Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 11/12] ci: add a problem matcher for GitHub Actions Đoàn Trần Công Danh
2020-04-08  4:05   ` [PATCH v4 12/12] ci: let GitHub Actions upload failed tests' directories Đoàn Trần Công Danh
2020-04-09 21:19   ` [PATCH v4 00/12] ci: replace our Azure Pipeline by GitHub Actions Junio C Hamano
2020-04-10 14:34     ` Johannes Schindelin
2020-04-10 14:37       ` Johannes Schindelin
2020-04-10 17:35         ` Danh Doan
2020-04-10 15:42       ` Junio C Hamano
2020-04-10 17:41         ` Danh Doan
2020-04-16  0:49           ` Junio C Hamano
2020-04-16  1:28             ` fixing ci failure of 'pu' with the es/bugreport topic Junio C Hamano
2020-04-16  1:55               ` Emily Shaffer
2020-04-16  3:20                 ` Junio C Hamano
2020-04-16  3:45                 ` Elijah Newren
2020-04-16  4:10                   ` Emily Shaffer
2020-04-16  4:57                     ` Junio C Hamano
2020-04-16 11:26                   ` Danh Doan
2020-04-16 12:05                     ` Johannes Schindelin
2020-04-16 12:08             ` [PATCH v4 00/12] ci: replace our Azure Pipeline by GitHub Actions Johannes Schindelin
2020-04-16 15:55               ` Junio C Hamano
2020-04-10 17:18 ` [PATCH v5 " Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 01/12] ci/lib: if CI type is unknown, show the environment variables Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 02/12] ci/lib: allow running in GitHub Actions Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 03/12] ci/lib: set TERM environment variable if not exist Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 04/12] ci: fix the `jobname` of the `GETTEXT_POISON` job Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 05/12] ci: explicit install all required packages Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 06/12] ci: run gem with sudo to install asciidoctor Đoàn Trần Công Danh
2020-04-10 17:18   ` Đoàn Trần Công Danh [this message]
2020-04-10 17:18   ` [PATCH v5 08/12] README: add a build badge for the GitHub Actions runs Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 09/12] ci: retire the Azure Pipelines definition Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 10/12] tests: when run in Bash, annotate test failures with file name/line number Đoàn Trần Công Danh
2020-05-04 17:46     ` Carlo Marcelo Arenas Belón
2020-05-04 23:25       ` Danh Doan
2020-05-05  0:35         ` Junio C Hamano
2020-05-06  7:30           ` Carlo Marcelo Arenas Belón
2020-05-06 12:54             ` Johannes Schindelin
2020-05-06 13:46               ` Carlo Marcelo Arenas Belón
2020-05-06 14:33                 ` Johannes Schindelin
2020-05-07  6:10                   ` Carlo Marcelo Arenas Belón
2020-05-06 16:33                 ` Junio C Hamano
2020-05-05  0:54         ` Carlo Marcelo Arenas Belón
2020-05-15 13:16     ` Alban Gruin
2020-05-15 15:00       ` [RFC PATCH] t: move metadata into TAP test description Carlo Marcelo Arenas Belón
2020-05-15 15:08         ` Eric Sunshine
2020-05-15 15:38         ` Alban Gruin
2020-05-15 15:45           ` Carlo Marcelo Arenas Belón
2020-05-15 16:50             ` Junio C Hamano
2020-05-15 17:14               ` Carlo Marcelo Arenas Belón
2020-05-15 17:23                 ` Junio C Hamano
2020-05-15 22:42                   ` Johannes Schindelin
2020-05-15 22:57                     ` Junio C Hamano
2020-05-15 17:21               ` [PATCH 0/2] Unbreak TAP output under bash Junio C Hamano
2020-05-15 17:21                 ` [PATCH 1/2] Revert "t/test_lib: avoid naked bash arrays in file_lineno" Junio C Hamano
2020-05-15 17:21                 ` [PATCH 2/2] Revert "tests: when run in Bash, annotate test failures with file name/line number" Junio C Hamano
2020-05-15 16:38         ` [RFC PATCH] t: move metadata into TAP test description Junio C Hamano
2020-05-15 17:22           ` Carlo Marcelo Arenas Belón
2020-05-15 19:04         ` Alban Gruin
2020-05-15 15:28       ` [PATCH v5 10/12] tests: when run in Bash, annotate test failures with file name/line number Carlo Marcelo Arenas Belón
2020-05-15 15:33         ` Alban Gruin
2020-04-10 17:18   ` [PATCH v5 11/12] ci: add a problem matcher for GitHub Actions Đoàn Trần Công Danh
2020-04-10 17:18   ` [PATCH v5 12/12] ci: let GitHub Actions upload failed tests' directories Đoàn Trần Công Danh

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=40fe4f7e2c34c6997a6824ef0dc6aad7a71a4434.1586538752.git.congdanhqx@gmail.com \
    --to=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --subject='Re: [PATCH v5 07/12] ci: configure GitHub Actions for CI/PR' \
    /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

Code repositories for project(s) associated with this 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).