Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/version_cross_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: version_cross_checks
permissions:
contents: read
on:
pull_request:
push:
branches:
- "main"

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "oldstable"

# fails if go.mod, Dockerfile, app.yaml, and cloudbuild.yaml are not in sync
- run: ./scripts/go_version_consistency.bash
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage.
FROM golang:1.25-alpine as builder
FROM golang:1.26-alpine as builder
RUN apk add --no-cache git
WORKDIR /go/src/m-lab/autojoin
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ service: autojoin

runtime_config:
operating_system: "ubuntu22"
runtime_version: "1.25"
runtime_version: "1.26"

endpoints_api_service:
name: autojoin-dot-{{PROJECT_ID}}.appspot.com
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ options:

steps:
# Run unit tests for environment.
- name: golang:1.25-alpine
- name: golang:1.26-alpine
entrypoint: sh
args:
- -c
Expand Down
25 changes: 25 additions & 0 deletions scripts/go_version_consistency.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail

go_major_minor="$(go mod edit -json | jq -r .Go | awk -F. '{print $1"."$2}')"

expect_alpine="golang:${go_major_minor}-alpine"
expect_gae="runtime_version: \"${go_major_minor}\""

exit_code=0
if ! grep -qF "$expect_alpine" Dockerfile; then
echo "ERROR: Dockerfile is not using '$expect_alpine'; please fix it."
exit_code=1
fi

if ! grep -qF "$expect_gae" app.yaml; then
echo "ERROR: app.yaml is not using '$expect_gae'; please fix it."
exit_code=1
fi

if ! grep -qF "$expect_alpine" cloudbuild.yaml; then
echo "ERROR: cloudbuild.yaml is not using '$expect_alpine'; please fix it."
exit_code=1
fi

exit "${exit_code}"
Loading