Skip to content

Commit

Permalink
add support for go 1.20 (#2023)
Browse files Browse the repository at this point in the history
* add support for go 1.20

* fix ddb streams attribute value test

* add sandbox testing support for go 1.20

* commonize sandbox docker files and fix codegen ci action
  • Loading branch information
aajtodd authored Feb 17, 2023
1 parent 4616bae commit ef149ec
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go-version: [1.19]
go-version: ["1.20"]
env:
JAVA_TOOL_OPTIONS: "-Xmx2g"
steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: [1.19, 1.18]
go-version: [1.19, "1.20"]
steps:
- uses: actions/checkout@v2

Expand All @@ -38,7 +38,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: [1.17, 1.16, 1.15]
go-version: [1.15, 1.16, 1.17, 1.18]
exclude:
- os: macos-latest
go-version: 1.15
Expand All @@ -61,7 +61,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
go-version: [1.19, 1.18]
go-version: [1.19, "1.20"]
env:
EACHMODULE_SKIP: "internal\\repotools\\changes"
steps:
Expand All @@ -82,7 +82,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
go-version: [1.17, 1.16, 1.15]
go-version: [1.15, 1.16, 1.17, 1.18]
env:
EACHMODULE_SKIP: "internal\\repotools\\changes"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.19.x]
go-version: [1.20.x]
os: [ubuntu-latest] # other options: macos-latest, windows-latest
steps:
- uses: actions/checkout@v2
Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,22 @@ list-deps-%:
###################
.PHONY: sandbox-tests sandbox-build-% sandbox-run-% sandbox-test-% update-aws-golang-tip

sandbox-tests: sandbox-test-go1.15 sandbox-test-go1.16 sandbox-test-go1.17 sandbox-test-gotip
sandbox-tests: sandbox-test-go1.15 sandbox-test-go1.16 sandbox-test-go1.17 sandbox-test-go1.18 sandbox-test-go1.19 sandbox-test-go1.20 sandbox-test-gotip

sandbox-build-%:
@# sandbox-build-go1.17
@# sandbox-build-gotip
docker build \
-f ./internal/awstesting/sandbox/Dockerfile.test.$(subst sandbox-build-,,$@) \
-t "aws-sdk-go-$(subst sandbox-build-,,$@)" .
@if [ $@ == sandbox-build-gotip ]; then\
docker build \
-f ./internal/awstesting/sandbox/Dockerfile.test.gotip \
-t "aws-sdk-go-$(subst sandbox-build-,,$@)" . ;\
else\
docker build \
--build-arg GO_VERSION=$(subst sandbox-build-go,,$@) \
-f ./internal/awstesting/sandbox/Dockerfile.test.goversion \
-t "aws-sdk-go-$(subst sandbox-build-,,$@)" . ;\
fi

sandbox-run-%: sandbox-build-%
@# sandbox-run-go1.17
@# sandbox-run-gotip
Expand Down
4 changes: 2 additions & 2 deletions codegen/copy_go_codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
set -xe

SDK_ROOT=$1
CODGEN_ROOT=$2
CODEGEN_ROOT=$2

REPOTOOLS_VERSION="${REPOTOOLS_VERSION:-latest}"

cd "$1"
go run github.com/awslabs/aws-go-multi-module-repository-tools/cmd/gomodgen@${REPOTOOLS_VERSION} -build "$CODGEN_ROOT"
go run github.com/awslabs/aws-go-multi-module-repository-tools/cmd/gomodgen@${REPOTOOLS_VERSION} -build "$CODEGEN_ROOT"
4 changes: 4 additions & 0 deletions feature/dynamodb/attributevalue/field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,15 @@ func TestCachedFields(t *testing.T) {
}

for tagKey, cs := range cases {
tagKey := tagKey
cs := cs
for _, c := range cs {
name := tagKey
if name == "" {
name = "none"
}

c := c
t.Run(fmt.Sprintf("%s/%s", name, c.Name), func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 3 additions & 0 deletions feature/dynamodbstreams/attributevalue/field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,14 @@ func TestCachedFields(t *testing.T) {
}

for tagKey, cs := range cases {
tagKey := tagKey
cs := cs
for _, c := range cs {
name := tagKey
if name == "" {
name = "none"
}
c := c
t.Run(fmt.Sprintf("%s/%s", name, c.Name), func(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 4 additions & 2 deletions internal/awstesting/sandbox/Dockerfile.golang-tip
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ FROM buildpack-deps:buster-scm

ENV GOLANG_SRC_REPO_URL https://github.com/golang/go

ENV GOLANG_BOOTSTRAP_URL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz
ENV GOLANG_BOOTSTRAP_SHA256 ce3140662f45356eb78bc16a88fc7cfb29fb00e18d7c632608245b789b2086d2
# as of 1.20 Go 1.17 is required to bootstrap
# see https://github.com/golang/go/issues/44505
ENV GOLANG_BOOTSTRAP_URL https://go.dev/dl/go1.17.13.linux-amd64.tar.gz
ENV GOLANG_BOOTSTRAP_SHA256 4cdd2bc664724dc7db94ad51b503512c5ae7220951cac568120f64f8e94399fc
ENV GOLANG_BOOTSTRAP_PATH /usr/local/bootstrap

# gcc for cgo
Expand Down
12 changes: 0 additions & 12 deletions internal/awstesting/sandbox/Dockerfile.test.go1.15

This file was deleted.

12 changes: 0 additions & 12 deletions internal/awstesting/sandbox/Dockerfile.test.go1.16

This file was deleted.

12 changes: 0 additions & 12 deletions internal/awstesting/sandbox/Dockerfile.test.go1.17

This file was deleted.

12 changes: 0 additions & 12 deletions internal/awstesting/sandbox/Dockerfile.test.go1.18

This file was deleted.

12 changes: 0 additions & 12 deletions internal/awstesting/sandbox/Dockerfile.test.go1.19

This file was deleted.

12 changes: 8 additions & 4 deletions internal/awstesting/sandbox/Dockerfile.test.gotip
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ FROM aws-golang:tip

ENV GOPROXY=direct

ADD . /go/src/github.com/aws/aws-sdk-go-v2

RUN apt-get update && apt-get install -y --no-install-recommends \
vim \
&& rm -rf /var/list/apt/lists/*
software-properties-common \
&& wget -O- https://apt.corretto.aws/corretto.key | apt-key add - \
&& add-apt-repository 'deb https://apt.corretto.aws stable main' \
&& apt-get update && apt-get install -y --no-install-recommends \
vim \
java-17-amazon-corretto-jdk \
&& rm -rf /var/list/apt/lists/*

ADD . /go/src/github.com/aws/aws-sdk-go-v2
WORKDIR /go/src/github.com/aws/aws-sdk-go-v2
CMD ["make", "unit"]
18 changes: 18 additions & 0 deletions internal/awstesting/sandbox/Dockerfile.test.goversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ARG GO_VERSION
FROM golang:${GO_VERSION}

ENV GOPROXY=direct

RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
&& wget -O- https://apt.corretto.aws/corretto.key | apt-key add - \
&& add-apt-repository 'deb https://apt.corretto.aws stable main' \
&& apt-get update && apt-get install -y --no-install-recommends \
vim \
java-17-amazon-corretto-jdk \
&& rm -rf /var/list/apt/lists/*

ADD . /go/src/github.com/aws/aws-sdk-go-v2

WORKDIR /go/src/github.com/aws/aws-sdk-go-v2
CMD ["make", "unit"]

0 comments on commit ef149ec

Please sign in to comment.