Subject: Re: [PATCH 3/5] ci: configure GitHub Actions for CI/PR

From: SZEDER Gábor <[email-masked]>
Date: Sat, 4 Apr 2020 00:07:32 +0200

On Tue, Mar 31, 2020 at 12:48:31PM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <[email-masked]>
> 
> 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.

And then receive emails from GitHub if a build fails, even though you
never asked for it?  Well, I've always preferred opt-in instead of
opt-out.

Btw, does it offer direct shell access for debugging?

> Therefore, it makes a lot of sense for us to have a working GitHub
> Actions setup.
> 
> While transmogrifying `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 being available by
> grace of using Git for Windows' Bash that is installed on the build
> agents). This accelerates that step from ~1m50s to ~7s.
> 
> Also, we do away with the parts that try to mount a file share on which
> `prove` can store data between runs.

... and on which we store the list of already successfully tested
trees, so when a branch is rebased changing e.g. only the commit
messages but leaving the code intact, then the CI won't run
unnecessary builds.

> It is just too complicated to set
> up, so it's little return on investment there.
> 
> Signed-off-by: Johannes Schindelin <[email-masked]>
> ---

> +  linux-clang:
> +    runs-on: ubuntu-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: install dependencies
> +      env:
> +        CC: clang
> +      run: |
> +        sudo apt-get update &&
> +        sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin &&

Why install all these dependencies here, when the very next command is
'ci/install-dependencies.sh', whose purpose is to install the
dependencies?

> +        ci/install-dependencies.sh
> +    - name: ci/run-build-and-test.sh
> +      env:
> +        CC: clang
> +      run: |
> +        ci/run-build-and-tests.sh || {
> +          ci/print-test-failures.sh
> +          exit 1
> +        }
> +  linux-gcc:
> +    runs-on: ubuntu-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: install dependencies
> +      run: |
> +        sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
> +        sudo apt-get update &&
> +        sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2 language-pack-is git-svn gcc-8 &&

Likewise, and here you install some additional packages compared to
the clang job as well.

> +        ci/install-dependencies.sh
> +    - name: ci/run-build-and-tests.sh
> +      run: |
> +        ci/run-build-and-tests.sh || {
> +          ci/print-test-failures.sh
> +          exit 1
> +        }
> +  osx-clang:
> +    runs-on: macos-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: install dependencies
> +      env:
> +        CC: clang
> +      run: ci/install-dependencies.sh
> +    - name: ci/run-build-and-tests.sh
> +      env:
> +        CC: clang
> +      run: |
> +        ci/run-build-and-tests.sh || {
> +          ci/print-test-failures.sh
> +          exit 1
> +        }
> +  osx-gcc:
> +    runs-on: macos-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: install dependencies
> +      run: ci/install-dependencies.sh
> +    - name: ci/run-build-and-tests.sh
> +      run: |
> +        ci/run-build-and-tests.sh || {
> +          ci/print-test-failures.sh
> +          exit 1
> +        }
> +  GETTEXT_POISON:
> +    runs-on: ubuntu-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: install dependencies
> +      run: |
> +        sudo apt-get update &&
> +        sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev
> +    - name: ci/run-build-and-tests.sh
> +      env:
> +        jobname: GETTEXT_POISON
> +      run: |
> +        ci/run-build-and-tests.sh || {
> +          ci/print-test-failures.sh
> +          exit 1
> +        }
> +  linux32:
> +    runs-on: ubuntu-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: ci/run-linux32-docker.sh
> +      run: |
> +        res=0
> +        sudo GITHUB_ACTIONS="$GITHUB_ACTIONS" RUNNER_OS="$RUNNER_OS" GITHUB_REF="$GITHUB_REF" GITHUB_SHA="$GITHUB_SHA" GITHUB_REPOSITORY="$GITHUB_REPOSITORY" GITHUB_RUN_ID="$GITHUB_RUN_ID" CC=$CC MAKEFLAGS="$MAKEFLAGS" bash -lxc ci/run-linux32-docker.sh || res=1
> +  static-analysis:
> +    runs-on: ubuntu-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: install dependencies
> +      run: |
> +        sudo apt-get update &&
> +        sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext

Likewise, except here you don't even run 'ci/install-dependencies.sh'
(which would install the same packages, btw.)

> +    - name: ci/run-static-analysis.sh
> +      env:
> +        jobname: StaticAnalysis
> +      run: ci/run-static-analysis.sh
> +  documentation:
> +    runs-on: ubuntu-latest
> +    steps:
> +    - uses: actions/checkout@v1
> +    - name: install dependencies
> +      run: |
> +        sudo apt-get update &&
> +        sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns
> +    - name: ci/test-documentation.sh
> +      env:
> +        ALREADY_HAVE_ASCIIDOCTOR: yes.
> +        jobname: Documentation
> +      run: ci/test-documentation.sh
> -- 
> gitgitgadget
>