From: Junio C Hamano Date: Mon, 16 Jan 2023 20:07:46 +0000 (-0800) Subject: Merge branch 'tb/ci-concurrency' X-Git-Tag: v2.40.0-rc0~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=763f20fb4ad3108634b05f45b575d95ed13ab861;p=thirdparty%2Fgit.git Merge branch 'tb/ci-concurrency' Avoid unnecessary builds in CI, with settings configured in ci-config. * tb/ci-concurrency: ci: avoid unnecessary builds --- 763f20fb4ad3108634b05f45b575d95ed13ab861 diff --cc .github/workflows/main.yml index 5afa73092d,d27cd44584..30492eacdd --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@@ -34,10 -35,18 +35,18 @@@ jobs then enabled=no fi + + 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 "::set-output name=enabled::$enabled" - echo "::set-output name=skip_concurrent::$skip_concurrent" + 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}} @@@ -82,8 -91,11 +91,11 @@@ 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 @@@ -106,9 -118,12 +118,12 @@@ 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}} @@@ -137,11 -152,14 +152,14 @@@ 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' @@@ -320,8 -343,11 +347,11 @@@ 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