]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tb/ci-concurrency'
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Jan 2023 20:07:46 +0000 (12:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Jan 2023 20:07:46 +0000 (12:07 -0800)
Avoid unnecessary builds in CI, with settings configured in
ci-config.

* tb/ci-concurrency:
  ci: avoid unnecessary builds

1  2 
.github/workflows/check-whitespace.yml
.github/workflows/l10n.yml
.github/workflows/main.yml

Simple merge
index 5afa73092d01605e205dc53cfd04f989c5f71a24,d27cd44584c44f49b124ad0d816191a7193762e4..30492eacddfc7db484e9c73af3ba49960d77f5cb
@@@ -34,10 -35,18 +35,18 @@@ jobs
            then
              enabled=no
            fi
 -          echo "::set-output name=enabled::$enabled"
 -          echo "::set-output name=skip_concurrent::$skip_concurrent"
+           skip_concurrent=yes
+           if test -x config-repo/ci/config/skip-concurrent &&
+              ! config-repo/ci/config/skip-concurrent '${{ github.ref }}'
+           then
+             skip_concurrent=no
+           fi
 +          echo "enabled=$enabled" >>$GITHUB_OUTPUT
++          echo "skip_concurrent=$skip_concurrent" >>$GITHUB_OUTPUT
        - name: skip if the commit or tree was already tested
          id: skip-if-redundant
 -        uses: actions/github-script@v3
 +        uses: actions/github-script@v6
          if: steps.check-ref.outputs.enabled == 'yes'
          with:
            github-token: ${{secrets.GITHUB_TOKEN}}
      needs: ci-config
      if: needs.ci-config.outputs.enabled == 'yes'
      runs-on: windows-latest
+     concurrency:
+       group: windows-build-${{ github.ref }}
+       cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
      steps:
 -    - uses: actions/checkout@v2
 +    - uses: actions/checkout@v3
      - uses: git-for-windows/setup-git-for-windows-sdk@v1
      - name: build
        shell: bash
        fail-fast: false
        matrix:
          nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+     concurrency:
+       group: windows-test-${{ matrix.nr }}-${{ github.ref }}
+       cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
      steps:
      - name: download tracked files and build artifacts
 -      uses: actions/download-artifact@v2
 +      uses: actions/download-artifact@v3
        with:
          name: windows-artifacts
          path: ${{github.workspace}}
        NO_PERL: 1
        GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
      runs-on: windows-latest
+     concurrency:
+       group: vs-build-${{ github.ref }}
+       cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
      steps:
 -    - uses: actions/checkout@v2
 +    - uses: actions/checkout@v3
      - uses: git-for-windows/setup-git-for-windows-sdk@v1
      - name: initialize vcpkg
 -      uses: actions/checkout@v2
 +      uses: actions/checkout@v3
        with:
          repository: 'microsoft/vcpkg'
          path: 'compat/vcbuild/vcpkg'
      env:
        jobname: StaticAnalysis
      runs-on: ubuntu-22.04
+     concurrency:
+       group: static-analysis-${{ github.ref }}
+       cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
      steps:
 -    - uses: actions/checkout@v2
 +    - uses: actions/checkout@v3
      - run: ci/install-dependencies.sh
      - run: ci/run-static-analysis.sh
      - run: ci/check-directional-formatting.bash