diff --git a/go/cloudbuild-test.yaml b/go/cloudbuild-test.yaml index 186e6b63..5a6e9a78 100644 --- a/go/cloudbuild-test.yaml +++ b/go/cloudbuild-test.yaml @@ -51,6 +51,24 @@ steps: ] waitFor: ["go125-build"] + + # Go 1.26 build + - name: gcr.io/cloud-builders/docker + args: ["build", "-t", "us-central1-docker.pkg.dev/$PROJECT_ID/go126", "."] + dir: go/go126 + id: go126-build + waitFor: ["-"] + - name: gcr.io/gcp-runtimes/structure_test + args: + [ + "-i", + "us-central1-docker.pkg.dev/$PROJECT_ID/go126", + "--config", + "/workspace/go/go126.yaml", + "-v", + ] + waitFor: ["go126-build"] + # Go 1.25 release build - name: gcr.io/cloud-builders/docker args: ["build", "-t", "us-central1-docker.pkg.dev/$PROJECT_ID/release-images/go125", "."] diff --git a/go/cloudbuild.yaml b/go/cloudbuild.yaml index 23711b4d..54e00c02 100644 --- a/go/cloudbuild.yaml +++ b/go/cloudbuild.yaml @@ -51,9 +51,27 @@ steps: ] waitFor: ["go125-build"] + # Go 1.26 build + - name: gcr.io/cloud-builders/docker + args: ["build", "-t", "gcr.io/$PROJECT_ID/go126", "."] + dir: go/go126 + id: go126-build + waitFor: ["-"] + - name: gcr.io/gcp-runtimes/structure_test + args: + [ + "-i", + "gcr.io/$PROJECT_ID/go126", + "--config", + "/workspace/go/go126.yaml", + "-v", + ] + waitFor: ["go126-build"] + images: - gcr.io/$PROJECT_ID/go124 - gcr.io/$PROJECT_ID/go125 + - gcr.io/$PROJECT_ID/go126 options: logging: CLOUD_LOGGING_ONLY diff --git a/go/go126.yaml b/go/go126.yaml new file mode 100644 index 00000000..053afc2c --- /dev/null +++ b/go/go126.yaml @@ -0,0 +1,22 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +schemaVersion: 1.0.0 +commandTests: + - name: "version" + command: ["go", "version"] + expectedOutput: ["go version go1.26"] + - name: "gcloud" + command: ["gcloud", "version"] + expectedOutput: ["Google Cloud SDK"] diff --git a/go/go126/Dockerfile b/go/go126/Dockerfile new file mode 100644 index 00000000..0f07598f --- /dev/null +++ b/go/go126/Dockerfile @@ -0,0 +1,54 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.26 + +# Install dependencies +RUN set -ex; \ + apt-get update -y; \ + apt-get install -y \ + unzip wget vim \ + # for docker + apt-transport-https ca-certificates curl gnupg + +RUN install -m 0755 -d /etc/apt/keyrings && \ + curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ + chmod a+r /etc/apt/keyrings/docker.gpg && \ + echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null && \ + apt-get update +RUN apt-get install -y docker-ce docker-ce-cli containerd.io + +RUN rm -rf /var/lib/apt/lists/* + +# Install protoc +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.13.0/protoc-3.13.0-linux-x86_64.zip +RUN unzip protoc-3.13.0-linux-x86_64.zip +RUN mv bin/protoc /bin/protoc && which protoc + +# Install gcloud SDK +RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ + apt-get update -y && apt-get install google-cloud-cli -y + +# Install tools used in build +RUN (export GOTOOLCHAIN='auto' && \ + go install honnef.co/go/tools/cmd/staticcheck@latest && \ + go install github.com/jstemmer/go-junit-report@latest && \ + go install gotest.tools/gotestsum@latest && \ + go install golang.org/x/lint/golint@latest && \ + go install golang.org/x/tools/cmd/goimports@latest) + +WORKDIR $GOPATH