Skip to content

Commit

Permalink
build(go): switch to go 1.21
Browse files Browse the repository at this point in the history
Also update to the latest swaggo version, as the previous one did not work with go 1.21

Signed-off-by: Andrei Aaron <[email protected]>
  • Loading branch information
andaaron committed Nov 21, 2023
1 parent c7bd2a6 commit 65ce943
Show file tree
Hide file tree
Showing 34 changed files with 176 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
# Run benchmark with `go test -bench` and stores the output to a file
- name: Run benchmark
run: make BENCH_OUTPUT=ci-cd run-bench
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/branch-cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Cache go dependencies
id: cache-go-dependencies
uses: actions/cache@v3
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Install other dependencies
run: |
cd $GITHUB_WORKSPACE
go install github.com/swaggo/swag/cmd/swag@v1.8.12
go install github.com/swaggo/swag/cmd/swag@v1.16.2
sudo apt-get update
sudo apt-get install rpm
sudo apt-get install snapd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cloc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Check out source code
uses: actions/checkout@v4
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
go install github.com/swaggo/swag/cmd/swag@v1.8.12
go install github.com/swaggo/swag/cmd/swag@v1.16.2
go mod download
sudo apt-get update
sudo apt-get -y install rpm uidmap
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compare-binary-size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Checkout zot (main branch)
run: |
mkdir -p $GITHUB_WORKSPACE/zot_main
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ecosystem-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
go install github.com/swaggo/swag/cmd/swag@v1.8.12
go install github.com/swaggo/swag/cmd/swag@v1.16.2
go mod download
sudo apt-get update
sudo apt-get install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config rpm uidmap
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gc-stress-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x

- name: Run zb
id: bench
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x

- name: Run zb
id: bench
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- uses: ./.github/actions/setup-localstack
- name: Setup minio service
run: |
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- uses: ./.github/actions/setup-localstack
- name: Setup minio service
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: '1.20'
go-version: '1.21'
- uses: actions/checkout@v4
- name: Run linter with GH action
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gqlgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Install go-licenses
run: go install github.com/google/go-licenses@latest
- name: Check for forbidden licenses
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
go install github.com/swaggo/swag/cmd/swag@v1.8.12
go install github.com/swaggo/swag/cmd/swag@v1.16.2
go mod download
sudo apt-get update
sudo apt-get install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config rpm uidmap
Expand Down Expand Up @@ -67,11 +67,11 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
go install github.com/swaggo/swag/cmd/swag@v1.8.12
go install github.com/swaggo/swag/cmd/swag@v1.16.2
go mod download
- name: Run sync harness
run: |
Expand All @@ -85,7 +85,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- uses: ./.github/actions/setup-localstack

- name: Run zb
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- uses: ./.github/actions/setup-localstack

- name: Run zb
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/oci-conformance-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install go 1.20
- name: Install go 1.21
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Checkout this PR
uses: actions/checkout@v4
- name: Start zot server
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-3rdparty-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
golang_version:
- "1.20"
- "1.21"
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Docker Registry
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Cache go dependencies
id: cache-go-dependencies
uses: actions/cache@v3
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Cache go dependencies
id: cache-go-dependencies
uses: actions/cache@v3
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Cache go dependencies
id: cache-go-dependencies
uses: actions/cache@v3
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: download all workflow coverage files
uses: actions/download-artifact@v3
- name: merge code coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
go-version: 1.21.x
- name: Checkout
uses: actions/checkout@v4
- name: Build zot
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ACTION_VALIDATOR_VERSION := v0.5.3
ZUI_VERSION := commit-fad5572
ZUI_REPO_OWNER := project-zot
ZUI_REPO_NAME := zui
SWAGGER_VERSION := v1.8.12
SWAGGER_VERSION := v1.16.2
STACKER := $(TOOLSDIR)/bin/stacker
BATS := $(TOOLSDIR)/bin/bats
TESTDATA := $(TOP_LEVEL)/test/data
Expand Down Expand Up @@ -331,7 +331,7 @@ swagger:
update-licenses: check-linux
@echo "Detecting and updating licenses ... please be patient!"
go install github.com/google/go-licenses@latest
$(shell echo "Module | License URL | License" > THIRD-PARTY-LICENSES.md; echo "---|---|---" >> THIRD-PARTY-LICENSES.md; for i in $$(go list -m all | awk '{print $$1}'); do l=$$(go-licenses csv $$i 2>/dev/null); if [ $$? -ne 0 ]; then continue; fi; echo $$l | tr \, \| | tr ' ' '\n'; done | LC_ALL=C sort -u >> THIRD-PARTY-LICENSES.md)
./update_licenses.sh
$(eval UNCOMMITED_FILES = $(shell git status --porcelain | grep -c THIRD-PARTY-LICENSES.md))
@if [ $(UNCOMMITED_FILES) != 0 ]; then \
echo "THIRD-PARTY-LICENSES.md file needs to be updated";\
Expand Down
1 change: 0 additions & 1 deletion THIRD-PARTY-LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ golang.org/x/crypto/pkcs12|https://cs.opensource.google/go/x/crypto/+/v0.15.0:LI
golang.org/x/crypto/sha3|https://cs.opensource.google/go/x/crypto/+/v0.15.0:LICENSE|BSD-3-Clause
golang.org/x/crypto|https://cs.opensource.google/go/x/crypto/+/v0.15.0:LICENSE|BSD-3-Clause
golang.org/x/exp/constraints|https://cs.opensource.google/go/x/exp/+/7918f672:LICENSE|BSD-3-Clause
golang.org/x/exp|https://cs.opensource.google/go/x/exp/+/7918f672:LICENSE|BSD-3-Clause
golang.org/x/mod/semver|https://cs.opensource.google/go/x/mod/+/v0.13.0:LICENSE|BSD-3-Clause
golang.org/x/mod|https://cs.opensource.google/go/x/mod/+/v0.13.0:LICENSE|BSD-3-Clause
golang.org/x/net/html|https://cs.opensource.google/go/x/net/+/v0.18.0:LICENSE|BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---
# Stage 1: Install certs, build binary, create default config file
# ---
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.20 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile-conformance
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---
# Stage 1: Install certs, build binary, create default config file
# ---
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.20 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile-minimal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---
# Stage 1: Install certs, build binary, create default config file
# ---
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.20 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile-zb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---
# Stage 1: Install certs, build binary, create default config file
# ---
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.20 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile-zxp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---
# Stage 1: Build binary, create default config file
# ---
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.20 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion build/stacker-conformance.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
from:
type: docker
url: docker://ghcr.io/project-zot/golang:1.20
url: docker://ghcr.io/project-zot/golang:1.21
binds:
- ../. -> /zotcopy
run: |
Expand Down
2 changes: 1 addition & 1 deletion build/stacker-minimal.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
from:
type: docker
url: docker://ghcr.io/project-zot/golang:1.20
url: docker://ghcr.io/project-zot/golang:1.21
binds:
- ../. -> /zotcopy
run: |
Expand Down
2 changes: 1 addition & 1 deletion build/stacker-zb.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
from:
type: docker
url: docker://ghcr.io/project-zot/golang:1.20
url: docker://ghcr.io/project-zot/golang:1.21
binds:
- ../. -> /zotcopy
run: |
Expand Down
2 changes: 1 addition & 1 deletion build/stacker-zxp.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
from:
type: docker
url: docker://ghcr.io/project-zot/golang:1.20
url: docker://ghcr.io/project-zot/golang:1.21
binds:
- ../. -> /zotcopy
run: |
Expand Down
2 changes: 1 addition & 1 deletion build/stacker.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
from:
type: docker
url: docker://ghcr.io/project-zot/golang:1.20
url: docker://ghcr.io/project-zot/golang:1.21
binds:
- ../. -> /zotcopy
run: |
Expand Down
Loading

0 comments on commit 65ce943

Please sign in to comment.