Skip to content

ci: bump the actions group across 1 directory with 3 updates #45

ci: bump the actions group across 1 directory with 3 updates

ci: bump the actions group across 1 directory with 3 updates #45

Workflow file for this run

name: CI
# Build + test every module on pushes to main and on pull requests.
# Tests run per-module with an isolated, non-fail-fast matrix so a single
# module failure never masks the others (Requirement 11.2).
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs on the same ref to save runner minutes.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
GO_VERSION: "1.25.x"
jobs:
# Discover every Go module (the dir of each go.mod under apps/ and packages/)
# and emit a JSON array consumed by the matrix below.
discover:
name: Discover modules
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.find.outputs.modules }}
steps:
- uses: actions/checkout@v7
- id: find
name: Find go.mod directories
run: |
set -euo pipefail
modules=$(find apps packages -maxdepth 2 -name go.mod -exec dirname {} \; | sort | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "modules=${modules}" >> "$GITHUB_OUTPUT"
echo "Discovered modules: ${modules}"
# Build + test each module independently. fail-fast:false keeps every module
# reporting its own status even when a sibling fails.
test:
name: build+test ${{ matrix.module }}
needs: discover
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module: ${{ fromJSON(needs.discover.outputs.modules) }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: false
# Cache the build and module caches keyed by the module's go.sum.
- name: Cache Go caches
uses: actions/cache@v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.module }}-${{ hashFiles(format('{0}/go.sum', matrix.module)) }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.module }}-
${{ runner.os }}-go-
- name: go build
working-directory: ${{ matrix.module }}
run: go build ./...
- name: go test
working-directory: ${{ matrix.module }}
run: go test -race ./...
# Whole-workspace compile check via the repo's smoke script.
build-smoke:
name: build-smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Run build smoke test
run: ./scripts/build-smoke.sh