From 76c8939140eafa57517a692bfb65c874cd600cb3 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 5 Jun 2024 09:23:52 +0200 Subject: [PATCH 1/4] build-and-deploy: disallow GPG key retrieval to run into the 6h timeout Retrieving GPG keys should take only a couple of minutes at most. In https://github.com/git-for-windows/git-for-windows-automation/actions/runs/9374447637/job/25825004745, for example, it took only eleven seconds. If it takes longer, something is wrong, and we should not wait for six hours until the workflow run is canceled and we wasted precious Azure spend. This happened e.g. in https://github.com/git-for-windows/git-for-windows-automation/actions/runs/9374447637/job/25810488159 where most likely those haunted hangs of the x86_64 MSYS2 runtime running on Windows/ARM64 were the cause. Let's allow for network glitches and time out after five minutes. Signed-off-by: Johannes Schindelin --- .github/workflows/build-and-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 060e7aac..ed6ba3a7 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -162,6 +162,7 @@ jobs: bash -lc "set -x && rebase -v -i /usr/lib/perl5/core_perl/auto/Cwd/Cwd.dll" - name: Get GPG key(s) + timeout-minutes: 5 shell: bash env: CARCH: x86_64 # dummy, to allow sourcing cv2pdb's PKGBUILD as-is From 9141031f059cf08762da70d5f358791db0d240f7 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 5 Jun 2024 09:38:23 +0200 Subject: [PATCH 2/4] Sprinkle GitHub workflows with more timeouts Signed-off-by: Johannes Schindelin --- .github/workflows/build-and-deploy.yml | 2 ++ .github/workflows/git-artifacts.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index ed6ba3a7..12eaad85 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -124,6 +124,7 @@ jobs: run: git clone --depth 1 --single-branch -b main https://github.com/git-for-windows/build-extra /usr/src/build-extra - name: update the SDK ("pacman -Syyu") + timeout-minutes: 20 shell: powershell run: | & ("${{ steps.setup-sdk.outputs.result }}\update-via-pacman.ps1") @@ -204,6 +205,7 @@ jobs: echo "SIGNTOOL=git signtool" >>$GITHUB_ENV - name: Build ${{env.PACKAGE_TO_BUILD}} + timeout-minutes: ${{ env.PACKAGE_TO_BUILD== 'mingw-w64-llvm' && 360 || 150 }} env: GPGKEY: ${{secrets.GPGKEY}} MAKEPKG: ${{ env.REPO != 'MSYS2-packages' && env.PACKAGE_TO_BUILD != 'git-for-windows-keyring' && 'makepkg-mingw' || 'makepkg' }} diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml index 92f9b4e2..99053e96 100644 --- a/.github/workflows/git-artifacts.yml +++ b/.github/workflows/git-artifacts.yml @@ -261,6 +261,7 @@ jobs: echo -n "$CODESIGN_PASS" >.sig/codesign.pass git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"' - name: Prepare home directory for GPG signing + timeout-minutes: 5 if: env.GPGKEY != '' && steps.restore-cached-git-pkg.outputs.cache-hit != 'true' run: | echo '${{secrets.PRIVGPGKEY}}' | tr % '\n' | gpg $GPG_OPTIONS --import && @@ -277,6 +278,7 @@ jobs: private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} append-text: 'About to build the `${{env.MINGW_PACKAGE_PREFIX}}-git` package' - name: Build ${{env.MINGW_PACKAGE_PREFIX}}-git + timeout-minutes: 60 if: steps.restore-cached-git-pkg.outputs.cache-hit != 'true' env: GPGKEY: "${{secrets.GPGKEY}}" From edb330318b935caa3312d4e45c00ff948f75337c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 5 Jun 2024 10:10:30 +0200 Subject: [PATCH 3/4] self-hosted-runner: fix two linter issues The `false` value is a string, not a Boolean. And the `arm-deploy` Action wants to see the `scope` specified. Signed-off-by: Johannes Schindelin --- .github/workflows/create-azure-self-hosted-runners.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-azure-self-hosted-runners.yml b/.github/workflows/create-azure-self-hosted-runners.yml index f48988e9..4a53bbfd 100644 --- a/.github/workflows/create-azure-self-hosted-runners.yml +++ b/.github/workflows/create-azure-self-hosted-runners.yml @@ -23,7 +23,7 @@ on: type: string required: true description: Deallocate the runner immediately after creating it (useful for spinning up runners preemptively) - default: false + default: "false" env: ACTIONS_RUNNER_SCOPE: ${{ github.event.inputs.runner_scope }} @@ -157,6 +157,7 @@ jobs: deploymentName: deploy-${{ steps.generate-vm-name.outputs.vm_name }} template: ./azure-self-hosted-runners/azure-arm-template.json parameters: ./azure-self-hosted-runners/azure-arm-template-example-parameters.json ${{ env.AZURE_ARM_PARAMETERS }} + scope: resourcegroup - name: Show post-deployment script output env: From aa19ab1f8fbeadb104391da9743e657820684fd9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 7 Jun 2024 10:32:01 +0200 Subject: [PATCH 4/4] updpkgsums: fix typo in the filename The typo in the filename prevented the `/updpkgsums` command in https://github.com/git-for-windows/build-extra/pull/558#issuecomment-2154347092 from working. Signed-off-by: Johannes Schindelin --- .github/workflows/{updpksums.yml => updpkgsums.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{updpksums.yml => updpkgsums.yml} (100%) diff --git a/.github/workflows/updpksums.yml b/.github/workflows/updpkgsums.yml similarity index 100% rename from .github/workflows/updpksums.yml rename to .github/workflows/updpkgsums.yml