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 15, 2023
1 parent dd1c73c commit e4c9e5e
Show file tree
Hide file tree
Showing 32 changed files with 161 additions and 47 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 @@ -31,7 +31,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 @@ -58,7 +58,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 @@ -21,11 +21,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 @@ -21,7 +21,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 @@ -53,7 +53,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 @@ -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: Setup minio service
run: |
Expand Down Expand Up @@ -161,7 +161,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 @@ -22,7 +22,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 @@ -64,7 +64,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 @@ -105,7 +105,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 @@ -141,7 +141,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
2 changes: 1 addition & 1 deletion 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
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
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module zotregistry.io/zot

go 1.20
go 1.21

toolchain go1.21.4

require (
github.com/99designs/gqlgen v0.17.40
Expand Down
Loading

0 comments on commit e4c9e5e

Please sign in to comment.