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
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
// merges it once the branch protection's required checks pass (build, lint and
// unit-test, plus e2e in repos with an e2e/ harness; solutions-gitops-prod).
// Every other update still waits for a human review.
// Go itself counts: the build toolchain is the `toolchain` line in go.mod (the
// shared CI and e2e workflows build with it), so a Go patch release with an
// advisory lands in this PR too.
osvVulnerabilityAlerts: true,
vulnerabilityAlerts: {
// One PR for all open advisories in a repo. e2e runs one at a time per repo
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ on:
required: false

env:
# Common versions
GO_VERSION: '1.26.11'
# Common versions. Go comes from each repo's go.mod (toolchain directive).
GOLANGCI_VERSION: 'v2.11.4'
DOCKER_BUILDX_VERSION: 'v0.23.0'

Expand Down Expand Up @@ -45,7 +44,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false # The golangci-lint action does its own caching.

- name: Check go mod tidy
Expand All @@ -65,7 +64,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Run Unit Tests
run: go test -v -cover ./...
Expand Down Expand Up @@ -97,6 +96,20 @@ jobs:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

# The image is built with the Go toolchain pinned in the repo's go.mod
# (`toolchain goX.Y.Z`), which Renovate bumps (security fixes merge
# themselves after e2e). No fallback to the `go` directive: that is only
# the minimum language version and would silently build with an old Go.
- name: Read Go toolchain from go.mod
run: |
v=$(awk '$1 == "toolchain" { sub(/^go/, "", $2); print $2 }' go.mod)
if [ -z "$v" ]; then
echo "::error file=go.mod::go.mod needs a toolchain directive (e.g. 'toolchain go1.26.11'): the function image is built with that Go version. Keep the go directive lower (the minimum language version); go mod tidy drops a toolchain line equal to it."
exit 1
fi
echo "Building with Go $v"
echo "GO_VERSION=$v" >> "$GITHUB_ENV"

# We ask Docker to use GitHub Action's native caching support to speed up
# the build, per https://docs.docker.com/build/cache/backends/gha/.
- name: Build Runtime
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ env:
UP_ORG: ${{ secrets.UP_E2E_ORG }}
UP_GROUP: ${{ secrets.UP_E2E_GROUP }}
UP_ROBOT_ID: ${{ secrets.UP_E2E_ROBOT_ID }}
# Kept in lockstep with ci.yml / tag.yml and the go.mod floor (bumped manually,
# as elsewhere in these shared workflows).
GO_VERSION: '1.26.11'
# Throwaway e2e artifacts (the built function + the e2e project) are pushed under
# the e2e org (UP_ORG) the robot owns -- the e2e robot can't push to the
# github.repository (upbound/) namespace.
Expand Down Expand Up @@ -91,6 +88,21 @@ jobs:
echo "No e2e/ harness in this repo; nothing to run."
fi

# The image is built with the Go toolchain pinned in the repo's go.mod
# (`toolchain goX.Y.Z`), which Renovate bumps (security fixes merge
# themselves after e2e). No fallback to the `go` directive: that is only
# the minimum language version and would silently build with an old Go.
- name: Read Go toolchain from go.mod
if: steps.harness.outputs.present == 'true'
run: |
v=$(awk '$1 == "toolchain" { sub(/^go/, "", $2); print $2 }' go.mod)
if [ -z "$v" ]; then
echo "::error file=go.mod::go.mod needs a toolchain directive (e.g. 'toolchain go1.26.11'): the function image is built with that Go version. Keep the go directive lower (the minimum language version); go mod tidy drops a toolchain line equal to it."
exit 1
fi
echo "Building with Go $v"
echo "GO_VERSION=$v" >> "$GITHUB_ENV"

- name: Require e2e credentials
if: steps.harness.outputs.present == 'true'
run: |
Expand Down
Loading