Skip to content

Commit

Permalink
centralize Go version used
Browse files Browse the repository at this point in the history
the action now has a default, so we don't have to
specify the version anymore and we can
bump the version for all builds in a single place
  • Loading branch information
vroldanbet committed Feb 23, 2024
1 parent 0e3b233 commit b47f9b1
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 40 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on: # yamllint disable-line rule:truthy
types:
- "checks_requested"
env:
GO_VERSION: "~1.21.3"
DOCKERHUB_PUBLIC_ACCESS_TOKEN: "dckr_pat_8AEETZWxu8f7FvJUk9NrpyX_ZEQ"
DOCKERHUB_PUBLIC_USER: "spicedbgithubactions"
jobs:
Expand Down Expand Up @@ -53,8 +52,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "docker/login-action@v3"
with:
username: "${{ env.DOCKERHUB_PUBLIC_USER }}"
Expand All @@ -72,8 +69,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "Unit tests"
run: "go run mage.go test:unit"

Expand All @@ -86,8 +81,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "docker/login-action@v3"
with:
username: "${{ env.DOCKERHUB_PUBLIC_USER }}"
Expand All @@ -108,8 +101,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "docker/login-action@v3"
with:
username: "${{ env.DOCKERHUB_PUBLIC_USER }}"
Expand All @@ -129,7 +120,6 @@ jobs:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
go-version-file: "e2e/go.mod"
cache-dependency-path: "e2e/go.sum"
- name: "Cache Binaries"
Expand Down Expand Up @@ -181,7 +171,6 @@ jobs:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
go-version-file: "tools/analyzers/go.mod"
cache-dependency-path: "tools/analyzers/go.sum"
- name: "Analyzer tests"
Expand All @@ -195,8 +184,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "WASM tests"
run: "go run mage.go test:wasm"

Expand All @@ -209,8 +196,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "Generate Protos"
run: "go run mage.go gen:proto"
- uses: "chainguard-dev/actions/nodiff@main"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ on: # yamllint disable-line rule:truthy
merge_group:
types:
- "checks_requested"
env:
GO_VERSION: "~1.21.3"
jobs:
go-lint:
name: "Lint Go"
runs-on: "buildjet-4vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "Lint Go"
run: "go run mage.go lint:go"
- uses: "chainguard-dev/actions/nodiff@main"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on: # yamllint disable-line rule:truthy
permissions:
contents: "write"
packages: "write"
env:
GO_VERSION: "~1.21.3"
jobs:
goreleaser:
runs-on: "buildjet-4vcpu-ubuntu-2204"
Expand All @@ -17,8 +15,6 @@ jobs:
with:
fetch-depth: 0
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "authzed/actions/docker-login@main"
with:
quayio_token: "${{ secrets.QUAYIO_PASSWORD }}"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on: # yamllint disable-line rule:truthy
permissions:
contents: "write"
packages: "write"
env:
GO_VERSION: "~1.21.3"
jobs:
goreleaser:
runs-on: "buildjet-4vcpu-ubuntu-2204"
Expand All @@ -17,8 +15,6 @@ jobs:
with:
fetch-depth: 0
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "authzed/actions/docker-login@main"
with:
quayio_token: "${{ secrets.QUAYIO_PASSWORD }}"
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on: # yamllint disable-line rule:truthy
merge_group:
types:
- "checks_requested"
env:
GO_VERSION: "~1.21.3"
jobs:

codeql:
Expand All @@ -28,8 +26,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "authzed/actions/codeql@main"

trivy:
Expand All @@ -38,8 +34,6 @@ jobs:
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "aquasecurity/trivy-action@master"
with:
scan-type: "fs"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on: # yamllint disable-line rule:truthy
types: ["created"]
permissions:
contents: "write"
env:
GO_VERSION: "~1.21.3"
jobs:
build:
name: "Build WASM"
Expand All @@ -16,8 +14,6 @@ jobs:
with:
ref: "${{ env.GITHUB_SHA }}"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "Build WASM"
run: "go run mage.go build:wasm"
- uses: "shogo82148/actions-upload-release-asset@v1"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang:1.21.6-alpine3.18 AS spicedb-builder
FROM golang:1.22.0-alpine3.18 AS spicedb-builder
WORKDIR /go/src/app
RUN apk update && apk add --no-cache git
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=0 go build -v ./cmd/...

FROM golang:1.21.6-alpine3.18 AS health-probe-builder
FROM golang:1.22.0-alpine3.18 AS health-probe-builder
WORKDIR /go/src/app
RUN apk update && apk add --no-cache git
RUN git clone https://github.com/grpc-ecosystem/grpc-health-probe.git
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim: syntax=dockerfile
ARG BASE=cgr.dev/chainguard/static:latest

FROM golang:1.21.6-alpine3.18 AS health-probe-builder
FROM golang:1.22.0-alpine3.18 AS health-probe-builder
WORKDIR /go/src/app
RUN apk update && apk add --no-cache git
RUN git clone https://github.com/grpc-ecosystem/grpc-health-probe.git
Expand Down

0 comments on commit b47f9b1

Please sign in to comment.