Skip to content

Commit 34eaefd

Browse files
authored
chore(ci): Fix flaky tests (#1795)
Signed-off-by: Kemal Akkoyun <[email protected]>
1 parent 72eeefb commit 34eaefd

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/go.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ on:
77
- main
88
- "release-*"
99

10+
# Modified to avoid canceling all matrix jobs when one fails
11+
# Each job type will have its own concurrency group
1012
concurrency:
11-
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
13+
group: ${{ github.workflow }}-${{ github.job }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
1214
cancel-in-progress: true
1315

1416
# Minimal permissions to be inherited by any job that don't declare it's own permissions
@@ -32,13 +34,18 @@ jobs:
3234
echo "supported_versions=$matrix" >> $GITHUB_OUTPUT
3335
3436
test:
35-
name: Tests
37+
name: Tests (${{ matrix.go_version }})
3638
runs-on: ubuntu-latest
3739
needs: supportedVersions
38-
40+
# Set fail-fast to false to ensure all Go versions are tested regardless of failures
3941
strategy:
42+
fail-fast: false
4043
matrix:
4144
go_version: ${{ fromJSON(needs.supportedVersions.outputs.supported_versions) }}
45+
# Define concurrency at the job level for matrix jobs
46+
concurrency:
47+
group: ${{ github.workflow }}-test-${{ matrix.go_version }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
48+
cancel-in-progress: true
4249

4350
steps:
4451
- name: Checkout code
@@ -48,13 +55,8 @@ jobs:
4855
uses: actions/[email protected]
4956
with:
5057
go-version: ${{ matrix.go_version }}
51-
52-
- name: Cache Go modules
53-
id: cache
54-
uses: actions/cache@v4
55-
with:
56-
path: ~/go/pkg/mod
57-
key: v1-go${{ matrix.go_version }}
58+
check-latest: true
59+
cache-dependency-path: go.sum
5860

5961
- name: Run tests and check license
6062
run: make check_license test

0 commit comments

Comments
 (0)