mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 00:08:11 +00:00
Merge pull request #418 from elezar/bump-golang-version
Bump golang version to v1.22.1
This commit is contained in:
commit
97950d6b8d
24
.github/workflows/golang.yaml
vendored
24
.github/workflows/golang.yaml
vendored
@ -16,6 +16,9 @@ name: Golang
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- release-*
|
- release-*
|
||||||
@ -29,28 +32,45 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
name: Checkout code
|
||||||
|
- name: Get Golang version
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
GOLANG_VERSION=$( grep "GOLANG_VERSION :=" versions.mk )
|
||||||
|
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GOLANG_VERSION }}
|
||||||
- name: Lint
|
- name: Lint
|
||||||
uses: golangci/golangci-lint-action@v4
|
uses: golangci/golangci-lint-action@v4
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: -v --timeout 5m
|
args: -v --timeout 5m
|
||||||
skip-cache: true
|
skip-cache: true
|
||||||
|
- name: Check golang modules
|
||||||
|
run: make check-vendor
|
||||||
test:
|
test:
|
||||||
name: Unit test
|
name: Unit test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Get Golang version
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
GOLANG_VERSION=$( grep "GOLANG_VERSION :=" versions.mk )
|
||||||
|
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.20'
|
go-version: ${{ env.GOLANG_VERSION }}
|
||||||
- run: make test
|
- run: make test
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
name: Checkout code
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: make docker-build
|
run: make docker-build
|
||||||
|
14
Makefile
14
Makefile
@ -38,8 +38,8 @@ EXAMPLE_TARGETS := $(patsubst %,example-%, $(EXAMPLES))
|
|||||||
CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/))))
|
CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/))))
|
||||||
CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS))
|
CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS))
|
||||||
|
|
||||||
CHECK_TARGETS := golangci-lint
|
CHECK_TARGETS := lint
|
||||||
MAKE_TARGETS := binaries build check fmt lint-internal test examples cmds coverage generate licenses $(CHECK_TARGETS)
|
MAKE_TARGETS := binaries build check fmt test examples cmds coverage generate licenses vendor check-vendor $(CHECK_TARGETS)
|
||||||
|
|
||||||
TARGETS := $(MAKE_TARGETS) $(EXAMPLE_TARGETS) $(CMD_TARGETS)
|
TARGETS := $(MAKE_TARGETS) $(EXAMPLE_TARGETS) $(CMD_TARGETS)
|
||||||
|
|
||||||
@ -87,9 +87,17 @@ goimports:
|
|||||||
go list -f {{.Dir}} $(MODULE)/... \
|
go list -f {{.Dir}} $(MODULE)/... \
|
||||||
| xargs goimports -local $(MODULE) -w
|
| xargs goimports -local $(MODULE) -w
|
||||||
|
|
||||||
golangci-lint:
|
lint:
|
||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
|
|
||||||
|
vendor:
|
||||||
|
go mod tidy
|
||||||
|
go mod vendor
|
||||||
|
go mod verify
|
||||||
|
|
||||||
|
check-vendor: vendor
|
||||||
|
git diff --quiet HEAD -- go.mod go.sum vendor
|
||||||
|
|
||||||
licenses:
|
licenses:
|
||||||
go-licenses csv $(MODULE)/...
|
go-licenses csv $(MODULE)/...
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ NVIDIA_DOCKER_VERSION := 2.14.0
|
|||||||
NVIDIA_CONTAINER_RUNTIME_VERSION := 3.14.0
|
NVIDIA_CONTAINER_RUNTIME_VERSION := 3.14.0
|
||||||
|
|
||||||
CUDA_VERSION := 12.3.2
|
CUDA_VERSION := 12.3.2
|
||||||
GOLANG_VERSION := 1.20.5
|
GOLANG_VERSION := 1.22.1
|
||||||
|
|
||||||
BUILDIMAGE_TAG ?= devel-go$(GOLANG_VERSION)
|
BUILDIMAGE_TAG ?= devel-go$(GOLANG_VERSION)
|
||||||
BUILDIMAGE ?= ghcr.io/nvidia/k8s-test-infra:$(BUILDIMAGE_TAG)
|
BUILDIMAGE ?= ghcr.io/nvidia/k8s-test-infra:$(BUILDIMAGE_TAG)
|
||||||
|
Loading…
Reference in New Issue
Block a user