Skip to content

Commit e652773

Browse files
committed
tests: use go.mod as a version source in other workflows
1 parent 6d9143e commit e652773

3 files changed

Lines changed: 9 additions & 15 deletions

File tree

.github/workflows/codeql-analysis.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ jobs:
1717
language: [ 'go' ]
1818

1919
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
2023
- name: Setup Go
2124
uses: actions/setup-go@v5
2225
with:
23-
go-version: "1.23"
24-
25-
- name: Checkout repository
26-
uses: actions/checkout@v4
26+
go-version-file: 'go.mod'
27+
cache: true
2728

2829
- name: Initialize CodeQL
2930
uses: github/codeql-action/init@v3

.github/workflows/lint.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
- name: Run linters
1717
run: |
1818
make lint
19-
# TODO: Use 'go mod tidy -diff' instead once go 1.23 is out
20-
# https://github.com/golang/go/issues/27005
2119
- name: Ensure go.mod is up-to-date
2220
run: |
23-
if [ $(go mod tidy && git diff | wc -l) -gt 0 ]; then git diff && exit 1; fi
21+
if [ $(go mod tidy -diff | wc -l) -gt 0 ]; then git diff && exit 1; fi

.github/workflows/unit.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
fail-fast: false
15-
matrix:
16-
go-version:
17-
- "1.23.0"
18-
- "1"
1915
steps:
2016
- name: Checkout Gophercloud
2117
uses: actions/checkout@v4
22-
- name: Setup Go ${{ matrix.go-version }}
18+
- name: Setup Go
2319
uses: actions/setup-go@v5
2420
with:
25-
go-version: ${{ matrix.go-version }}
21+
go-version-file: 'go.mod'
22+
cache: true
2623
- name: Setup environment
2724
run: |
2825
# Changing into a different directory to avoid polluting go.sum with "go get"
@@ -37,7 +34,6 @@ jobs:
3734
uses: coverallsapp/github-action@v2
3835
with:
3936
file: cover.out
40-
flag-name: Go-${{ matrix.go-version }}
4137
parallel: true
4238
finish:
4339
permissions:
@@ -50,4 +46,3 @@ jobs:
5046
uses: coverallsapp/github-action@v2
5147
with:
5248
parallel-finished: true
53-
carryforward: Go-${{ join(matrix.go-version.*, '-') }}

0 commit comments

Comments
 (0)