Skip to content

Commit

Permalink
ci: test with Go 1.22
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander committed Oct 30, 2024
1 parent 81b54af commit a8f767d
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

# The built image can be found in:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

- name: binary-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"
- name: Check helm files
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

# The built image can be found in:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"
- name: Choose the Envoy API
run: |
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

- name: Unit test
Expand All @@ -138,7 +138,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

- name: Test
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

- name: Set up services
Expand Down Expand Up @@ -209,7 +209,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

- name: binary cache
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

- name: Example
Expand All @@ -297,7 +297,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache-dependency-path: "**/*.sum"

- name: binary cache
Expand Down
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ linters:
- bodyclose
- contextcheck
- errcheck
- exportloopref
- exportloopref # replace it with copyloopref once we upgrade the minimal Go requirement to 1.22
- forcetypeassert
- gocheckcompilerdirectives
- gocritic
Expand All @@ -31,6 +31,7 @@ linters-settings:
- opinionated
gosec:
excludes:
- G115 # Ignore "integer overflow conversion int". Since we call the coversion explicitly, we know what we do.
- G402 # TLS InsecureSkipVerify may be true.
revive:
rules:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ build-dev-tools:
build-dev-tools-local:
docker build --network=host --build-arg GOPROXY=${GOPROXY} -t ${DEV_TOOLS_IMAGE} -f tools/Dockerfile.dev ./tools

GOLANGCI_LINT_VERSION = 1.56.1
GOLANGCI_LINT_VERSION = 1.61.0
.PHONY: lint-go
lint-go:
if ! test -x $(LOCALBIN)/golangci-lint || ! $(LOCALBIN)/golangci-lint --version | grep $(GOLANGCI_LINT_VERSION) >/dev/null; then \
Expand Down
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PROJECT_NAME = mosn.io/htnn
DOCKER_MIRROR = m.daocloud.io/

# Both images use glibc 2.31. Ensure libc in the images match each other.
BUILD_IMAGE ?= $(DOCKER_MIRROR)docker.io/library/golang:1.21-bullseye
BUILD_IMAGE ?= $(DOCKER_MIRROR)docker.io/library/golang:1.22-bullseye
ENVOY_API_VERSION ?= 1.31
PROXY_IMAGE ?= $(DOCKER_MIRROR)docker.io/envoyproxy/envoy:contrib-v1.31.2
# We also support other Envoy versions. See https://github.com/mosn/htnn/tree/main/site/content/en/docs/developer-guide/dataplane_support.md
Expand Down
4 changes: 2 additions & 2 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ delete-cluster: kind
.PHONY: e2e-prepare-controller-image
e2e-prepare-controller-image: kind
cd ../manifests/ && CONTROLLER_IMAGE=htnn/controller:e2e CONTROLLER_BASE_IMAGE=$(DOCKER_MIRROR)docker.io/istio/pilot:$(ISTIO_VERSION) \
GO_BUILD_BASE_IMAGE=$(DOCKER_MIRROR)docker.io/golang:1.21 \
GO_BUILD_BASE_IMAGE=$(BUILD_IMAGE) \
make build-controller-image
$(KIND) load docker-image -n htnn htnn/controller:e2e

.PHONY: e2e-prepare-data-plane-image
e2e-prepare-data-plane-image: kind
cd ../manifests/ && PROXY_BASE_IMAGE=$(DOCKER_MIRROR)docker.io/istio/proxyv2:$(ISTIO_VERSION) \
GO_BUILD_BASE_IMAGE=$(DOCKER_MIRROR)docker.io/golang:1.21 \
GO_BUILD_BASE_IMAGE=$(BUILD_IMAGE) \
PROXY_IMAGE=htnn/gateway:e2e make build-proxy-image
$(KIND) load docker-image htnn/gateway:e2e --name htnn

Expand Down
2 changes: 1 addition & 1 deletion manifests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PROXY_IMAGE ?= htnn/proxy:latest
PROXY_BASE_IMAGE ?= istio/proxyv2:$(ISTIO_VERSION)
CONTROLLER_IMAGE ?= htnn/controller:latest
CONTROLLER_BASE_IMAGE ?= docker.io/istio/pilot:$(ISTIO_VERSION)
GO_BUILD_BASE_IMAGE ?= golang:1.21
GO_BUILD_BASE_IMAGE ?= golang:1.22

.PHONY: build-proxy-image
build-proxy-image:
Expand Down
2 changes: 1 addition & 1 deletion patch/apply-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ done

pushd "$TARGET_ISTIO_DIR"
go mod tidy
go install golang.org/x/tools/cmd/goimports@v0.24.0 # required by codegen. Version higher than 0.24.0 doesn't support Go 1.21.
go install golang.org/x/tools/cmd/goimports@v0.26.0
go run pkg/config/schema/codegen/tools/collections.main.go
popd

0 comments on commit a8f767d

Please sign in to comment.