diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 011cf2040..2cc0928bb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,8 +7,10 @@ on: - main - "release-*" +# Modified to avoid canceling all matrix jobs when one fails +# Each job type will have its own concurrency group concurrency: - group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.job }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} cancel-in-progress: true # Minimal permissions to be inherited by any job that don't declare it's own permissions @@ -32,13 +34,18 @@ jobs: echo "supported_versions=$matrix" >> $GITHUB_OUTPUT test: - name: Tests + name: Tests (${{ matrix.go_version }}) runs-on: ubuntu-latest needs: supportedVersions - + # Set fail-fast to false to ensure all Go versions are tested regardless of failures strategy: + fail-fast: false matrix: go_version: ${{ fromJSON(needs.supportedVersions.outputs.supported_versions) }} + # Define concurrency at the job level for matrix jobs + concurrency: + group: ${{ github.workflow }}-test-${{ matrix.go_version }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} + cancel-in-progress: true steps: - name: Checkout code @@ -48,13 +55,8 @@ jobs: uses: actions/setup-go@v5.4.0 with: go-version: ${{ matrix.go_version }} - - - name: Cache Go modules - id: cache - uses: actions/cache@v4 - with: - path: ~/go/pkg/mod - key: v1-go${{ matrix.go_version }} + check-latest: true + cache-dependency-path: go.sum - name: Run tests and check license run: make check_license test