Skip to content

Commit

Permalink
Bump go from 1.20.5 to 1.20.7
Browse files Browse the repository at this point in the history
- Honor .go-version file
- Fix tab indentation
  • Loading branch information
sevein authored and djjuhasz committed Aug 15, 2023
1 parent 29694ca commit c4c94de
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 19 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/atlas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
- name: Read Go version
id: go_version
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
- name: Install Go (${{ steps.go_version.outputs.go_version }})
uses: actions/setup-go@v4
with:
go-version: 1.19.x
go-version: ${{ steps.go_version.outputs.go_version }}
- name: Check atlas.sum
run: |
go run -mod=mod ariga.io/atlas/cmd/[email protected] \
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
- name: Read Go version
id: go_version
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
- name: Install Go (${{ steps.go_version.outputs.go_version }})
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: ${{ steps.go_version.outputs.go_version }}
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/mod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
- name: Read Go version
id: go_version
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
- name: Install Go (${{ steps.go_version.outputs.go_version }})
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: ${{ steps.go_version.outputs.go_version }}
- name: Check go.mod
run: |
go mod tidy
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/pulumi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
- name: Read Go version
id: go_version
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
- name: Install Go (${{ steps.go_version.outputs.go_version }})
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: ${{ steps.go_version.outputs.go_version }}
- name: Download Go dependencies
run: go mod download
working-directory: hack/pulumi
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ jobs:
test:
strategy:
fail-fast: false
matrix:
go-version:
- 1.20.x
platform:
- ubuntu-latest
runs-on: ${{ matrix.platform }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
- name: Read Go version
id: go_version
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
- name: Install Go (${{ steps.go_version.outputs.go_version }})
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
go-version: ${{ steps.go_version.outputs.go_version }}
cache: true
- name: Test
run: go test -race -coverprofile=covreport -covermode=atomic -coverpkg=$(./hack/coverpkgs.sh) -v ./...
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.5
1.20.7
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# syntax = docker/dockerfile:1.4

ARG TARGET=enduro
ARG GO_VERSION

FROM golang:1.20.5-alpine AS build-go
FROM golang:${GO_VERSION}-alpine AS build-go
WORKDIR /src
ENV CGO_ENABLED=0
COPY --link go.* ./
Expand Down
6 changes: 5 additions & 1 deletion hack/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ TILT_EXPECTED_REF=${EXPECTED_REF:-}
IMAGE_NAME="${TILT_EXPECTED_REF:-$DEFAULT_IMAGE_NAME}"
BUILD_OPTS="${BUILD_OPTS:-}"

GO_VERSION=$(cat .go-version)
test -n "$GO_VERSION" || { echo "Error: .go-version is empty."; exit 1; }

env DOCKER_BUILDKIT=1 docker build \
-t "$IMAGE_NAME" \
-f "$FOLDER/Dockerfile" \
--build-arg="TARGET=$TARGET" \
--build-arg="GO_VERSION=$GO_VERSION" \
--build-arg="VERSION_PATH=$VERSION_PATH" \
--build-arg="VERSION_LONG=$VERSION_LONG" \
--build-arg="VERSION_SHORT=$VERSION_SHORT" \
--build-arg="VERSION_GIT_HASH=$VERSION_GIT_HASH" \
$BUILD_OPTS \
$FOLDER
$FOLDER

0 comments on commit c4c94de

Please sign in to comment.