Skip to content

Commit

Permalink
ci: build and test with Go 1.23 (#1002)
Browse files Browse the repository at this point in the history
This PR updates the Go version used in our CI to Go 1.23. See
hetznercloud/cli#871 for a previous discussion.
  • Loading branch information
phm07 authored Sep 30, 2024
1 parent ac90449 commit 0f030a3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Build
on:
push:

env:
GOTOOLCHAIN: local

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -13,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: "1.23"

- name: Import GPG key
id: import_gpg
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on:
branches: [main]
pull_request:

env:
GOTOOLCHAIN: local

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: "1.23"

- uses: golangci/golangci-lint-action@v6
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "v*"

env:
GOTOOLCHAIN: local

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -17,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: "1.23"

- name: Import GPG key
id: import_gpg
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

env:
GOTOOLCHAIN: local

jobs:
unit:
runs-on: ubuntu-latest
Expand All @@ -14,7 +17,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: "1.23"

- run: go test -v -timeout=30s -parallel=8 -coverprofile=coverage.txt -coverpkg=./... ./...

Expand Down Expand Up @@ -71,7 +74,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: "1.23"

- uses: hetznercloud/tps-action@main

Expand Down
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cache:

build:
stage: build
image: golang:1.21
image: golang:1.23
script:
- go env
- go mod download
Expand All @@ -35,6 +35,6 @@ test:lint:

test:unit:
stage: test
image: golang:1.21
image: golang:1.23
script:
- make test
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/hetznercloud/terraform-provider-hcloud

go 1.21

toolchain go1.23.1

require (
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
Expand Down

0 comments on commit 0f030a3

Please sign in to comment.