Skip to content

Commit 97950d6

Browse files
authored
Merge pull request #418 from elezar/bump-golang-version
Bump golang version to v1.22.1
2 parents 1613f35 + c572c3b commit 97950d6

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

.github/workflows/golang.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ name: Golang
1616

1717
on:
1818
pull_request:
19+
types:
20+
- opened
21+
- synchronize
1922
branches:
2023
- main
2124
- release-*
@@ -29,28 +32,45 @@ jobs:
2932
runs-on: ubuntu-latest
3033
steps:
3134
- uses: actions/checkout@v4
32-
35+
name: Checkout code
36+
- name: Get Golang version
37+
id: vars
38+
run: |
39+
GOLANG_VERSION=$( grep "GOLANG_VERSION :=" versions.mk )
40+
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV
41+
- name: Install Go
42+
uses: actions/setup-go@v5
43+
with:
44+
go-version: ${{ env.GOLANG_VERSION }}
3345
- name: Lint
3446
uses: golangci/golangci-lint-action@v4
3547
with:
3648
version: latest
3749
args: -v --timeout 5m
3850
skip-cache: true
51+
- name: Check golang modules
52+
run: make check-vendor
3953
test:
4054
name: Unit test
4155
runs-on: ubuntu-latest
4256
steps:
4357
- name: Checkout code
4458
uses: actions/checkout@v4
59+
- name: Get Golang version
60+
id: vars
61+
run: |
62+
GOLANG_VERSION=$( grep "GOLANG_VERSION :=" versions.mk )
63+
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV
4564
- name: Install Go
4665
uses: actions/setup-go@v5
4766
with:
48-
go-version: '1.20'
67+
go-version: ${{ env.GOLANG_VERSION }}
4968
- run: make test
5069
build:
5170
runs-on: ubuntu-latest
5271
steps:
5372
- uses: actions/checkout@v4
73+
name: Checkout code
5474

5575
- name: Build
5676
run: make docker-build

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ EXAMPLE_TARGETS := $(patsubst %,example-%, $(EXAMPLES))
3838
CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/))))
3939
CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS))
4040

41-
CHECK_TARGETS := golangci-lint
42-
MAKE_TARGETS := binaries build check fmt lint-internal test examples cmds coverage generate licenses $(CHECK_TARGETS)
41+
CHECK_TARGETS := lint
42+
MAKE_TARGETS := binaries build check fmt test examples cmds coverage generate licenses vendor check-vendor $(CHECK_TARGETS)
4343

4444
TARGETS := $(MAKE_TARGETS) $(EXAMPLE_TARGETS) $(CMD_TARGETS)
4545

@@ -87,9 +87,17 @@ goimports:
8787
go list -f {{.Dir}} $(MODULE)/... \
8888
| xargs goimports -local $(MODULE) -w
8989

90-
golangci-lint:
90+
lint:
9191
golangci-lint run ./...
9292

93+
vendor:
94+
go mod tidy
95+
go mod vendor
96+
go mod verify
97+
98+
check-vendor: vendor
99+
git diff --quiet HEAD -- go.mod go.sum vendor
100+
93101
licenses:
94102
go-licenses csv $(MODULE)/...
95103

versions.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ NVIDIA_DOCKER_VERSION := 2.14.0
2828
NVIDIA_CONTAINER_RUNTIME_VERSION := 3.14.0
2929

3030
CUDA_VERSION := 12.3.2
31-
GOLANG_VERSION := 1.20.5
31+
GOLANG_VERSION := 1.22.1
3232

3333
BUILDIMAGE_TAG ?= devel-go$(GOLANG_VERSION)
3434
BUILDIMAGE ?= ghcr.io/nvidia/k8s-test-infra:$(BUILDIMAGE_TAG)

0 commit comments

Comments
 (0)