Skip to content

Commit d52a749

Browse files
authored
chore(ci): use go.mod go version in CI (#1762)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> --> Ramin found a nice update, reapplying here. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated GitHub workflows to use the Go version specified in `./go.mod` instead of a separate `go-version` input. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 1f4f2c8 commit d52a749

File tree

3 files changed

+6
-35
lines changed

3 files changed

+6
-35
lines changed

.github/workflows/ci_release.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,17 @@ on:
2323
- major
2424

2525
jobs:
26-
setup:
27-
runs-on: ubuntu-latest
28-
env:
29-
# use consistent go version throughout pipeline here
30-
GO_VERSION: "1.22"
31-
outputs:
32-
go-version: ${{ steps.set-vars.outputs.go-version }}
33-
steps:
34-
- name: Set go version
35-
id: set-vars
36-
run: echo "go-version=${{env.GO_VERSION}}" >> "$GITHUB_OUTPUT"
37-
3826
lint:
39-
needs: [setup]
4027
uses: ./.github/workflows/lint.yml
41-
with:
42-
go-version: ${{ needs.setup.outputs.go-version }}
4328

4429
test:
45-
needs: [setup]
4630
uses: ./.github/workflows/test.yml
47-
with:
48-
go-version: ${{ needs.setup.outputs.go-version }}
4931

5032
proto:
5133
uses: ./.github/workflows/proto.yml
5234

5335
cli:
5436
name: Test CLI
55-
needs: [setup]
5637
runs-on: ${{ matrix.os }}
5738
strategy:
5839
matrix:
@@ -62,7 +43,7 @@ jobs:
6243
- name: set up go
6344
uses: actions/setup-go@v5
6445
with:
65-
go-version: ${{ needs.setup.outputs.go-version }}
46+
go-version-file: ./go.mod
6647
- name: Build cli
6748
run: make install
6849
- name: Run cli

.github/workflows/lint.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
name: lint
44
on:
55
workflow_call:
6-
inputs:
7-
go-version:
8-
description: "Go version to use"
9-
type: string
10-
required: true
116

127
jobs:
138
golangci-lint:
@@ -17,7 +12,7 @@ jobs:
1712
- uses: actions/checkout@v4
1813
- uses: actions/setup-go@v5
1914
with:
20-
go-version: ${{ inputs.go-version }}
15+
go-version-file: ./go.mod
2116
# This steps sets the GIT_DIFF environment variable to true
2217
# if files defined in PATTERS changed
2318
- uses: technote-space/[email protected]
@@ -69,7 +64,7 @@ jobs:
6964
- name: set up go
7065
uses: actions/setup-go@v5
7166
with:
72-
go-version: ${{ inputs.go-version }}
67+
go-version-file: ./go.mod
7368
- name: install rollkit cli
7469
run: make install
7570
- name: Generate Docs

.github/workflows/test.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
name: Tests / Code Coverage
44
on:
55
workflow_call:
6-
inputs:
7-
go-version:
8-
description: "Go version to use"
9-
type: string
10-
required: true
116

127
jobs:
138
go_mod_tidy_check:
@@ -17,7 +12,7 @@ jobs:
1712
- uses: actions/checkout@v4
1813
- uses: actions/setup-go@v5
1914
with:
20-
go-version: ${{ inputs.go-version }}
15+
go-version-file: ./go.mod
2116
- run: go mod tidy
2217
- name: check for diff
2318
run: git diff --exit-code
@@ -30,7 +25,7 @@ jobs:
3025
- name: set up go
3126
uses: actions/setup-go@v5
3227
with:
33-
go-version: ${{ inputs.go-version }}
28+
go-version-file: ./go.mod
3429
- name: Run unit test
3530
run: make test
3631
- name: upload coverage report
@@ -47,6 +42,6 @@ jobs:
4742
- name: set up go
4843
uses: actions/setup-go@v5
4944
with:
50-
go-version: ${{ inputs.go-version }}
45+
go-version-file: ./go.mod
5146
- name: Integration Tests
5247
run: echo "No integration tests yet"

0 commit comments

Comments
 (0)