Skip to content

Commit

Permalink
chore: Bump to GoLang v1.21 (sourcenetwork#2195)
Browse files Browse the repository at this point in the history
## Relevant issue(s)
- Resolves sourcenetwork#2194
- Resolves sourcenetwork#2196


## Description
- This is a routine version bump of GoLang, the previous bump was done
in (sourcenetwork#1689)
- Also updates the golang version for AWS AMI generation.
- Updated the `ONLY_DEFRADB_REPO_CI_PAT` token as the terraform build
would fail otherwise as the token expired starting of this year.
  • Loading branch information
shahzadlone authored Jan 19, 2024
1 parent c1b3eff commit efe0dd5
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true

- name: Build all dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-vulnerabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Run govulncheck
uses: golang/govulncheck-action@v1
with:
go-version-input: "1.20"
go-version-input: "1.21"
go-package: ./...
check-latest: true
cache: true
2 changes: 1 addition & 1 deletion .github/workflows/lint-then-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true

- name: Run the golangci-lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true

- name: Check linting through golangci-lint
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:

- name: Apply tag
run: git tag ${{ github.event.inputs.tag }}

- name: Build modules
run: make deps:modules

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: matrix.os == 'ubuntu-latest'
Expand All @@ -58,11 +58,11 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true
cache: true

Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

release:
runs-on: ubuntu-latest
needs: prepare
Expand All @@ -110,10 +110,10 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true
cache: true

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

pull-docker-image:
name: Pull docker image job
runs-on: ubuntu-latest
Expand All @@ -168,9 +168,9 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Pull Docker image
run: docker pull ${{ matrix.image_tag }}

- name: Test Docker image
run: docker run --rm ${{ matrix.image_tag }}
run: docker run --rm ${{ matrix.image_tag }}
2 changes: 1 addition & 1 deletion .github/workflows/start-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true

- name: Build modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-and-upload-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true

- name: Build dependencies
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ verify:

.PHONY: tidy
tidy:
go mod tidy -go=1.20
go mod tidy -go=1.21

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/sourcenetwork/defradb

go 1.20
go 1.21

require (
github.com/bits-and-blooms/bitset v1.13.0
Expand Down
33 changes: 33 additions & 0 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tools/cloud/aws/packer/build_aws_ami.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ build {
inline = [
"/usr/bin/cloud-init status --wait",
"sudo apt-get update && sudo apt-get install make build-essential -y",
"curl -OL https://golang.org/dl/go1.20.6.linux-amd64.tar.gz",
"rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.20.6.linux-amd64.tar.gz",
"curl -OL https://golang.org/dl/go1.21.6.linux-amd64.tar.gz",
"rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz",
"export PATH=$PATH:/usr/local/go/bin",
"git clone \"https://git@$DEFRADB_GIT_REPO\"",
"cd ./defradb || { printf \"\\\ncd into defradb failed.\\\n\" && exit 2; }",
Expand Down
8 changes: 4 additions & 4 deletions tools/configs/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ run:

# Define the Go version limit.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`.
go: "1.20"
go: "1.21"

#=====================================================================================[ Output Configuration Options ]
output:
Expand Down Expand Up @@ -263,7 +263,7 @@ linters-settings:

gosimple:
# Select the Go version to target.
go: "1.20"
go: "1.21"
# https://staticcheck.io/docs/options#checks
checks: ["all", "-S1038"]
# Turn on all except (these are disabled):
Expand Down Expand Up @@ -355,13 +355,13 @@ linters-settings:

staticcheck:
# Select the Go version to target.
go: "1.20"
go: "1.21"
# https://staticcheck.io/docs/options#checks
checks: ["all"]

unused:
# Select the Go version to target.
go: "1.20"
go: "1.21"

whitespace:
# Enforces newlines (or comments) after every multi-line if statement.
Expand Down
2 changes: 1 addition & 1 deletion tools/defradb.containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN npm run build

# Stage: BUILD
# Several steps are involved to enable caching and because of the behavior of COPY regarding directories.
FROM docker.io/golang:1.20 AS BUILD
FROM docker.io/golang:1.21 AS BUILD
WORKDIR /repo/
COPY go.mod go.sum Makefile ./
RUN make deps:modules
Expand Down

0 comments on commit efe0dd5

Please sign in to comment.