Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -48,13 +55,8 @@ jobs:
uses: actions/[email protected]
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
Expand Down