84 lines
2.6 KiB
YAML
84 lines
2.6 KiB
YAML
name: Cross-Version Smoke Tests
|
|
|
|
on:
|
|
# On tag push (release gate): test the last 30 releases for broad regression coverage
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
# On PR to main: test only the last 5 releases for fast feedback
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
# Allow manual trigger with custom version count
|
|
workflow_dispatch:
|
|
inputs:
|
|
version_count:
|
|
description: 'Number of previous releases to test against'
|
|
required: false
|
|
default: '5'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
smoke:
|
|
name: Upgrade smoke (${{ matrix.prev_version }} → candidate)
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
prev_version: ${{ fromJson(needs.versions.outputs.matrix) }}
|
|
|
|
needs: versions
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.name "CI Bot"
|
|
git config --global user.email "ci@beads.test"
|
|
|
|
- name: Cache previous release binaries
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
|
|
with:
|
|
path: ~/.cache/beads-regression
|
|
key: smoke-binaries-${{ matrix.prev_version }}-${{ runner.os }}
|
|
|
|
- name: Build candidate binary
|
|
run: go build -tags gms_pure_go -o /tmp/bd-candidate ./cmd/bd
|
|
|
|
- name: Run upgrade smoke tests
|
|
env:
|
|
CANDIDATE_BIN: /tmp/bd-candidate
|
|
run: ./scripts/upgrade-smoke-test.sh ${{ matrix.prev_version }}
|
|
|
|
versions:
|
|
name: Resolve versions to test
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.resolve.outputs.matrix }}
|
|
steps:
|
|
- name: Resolve release versions
|
|
id: resolve
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
# Tag push and manual dispatch test more versions; PRs test fewer for speed
|
|
VERSION_COUNT: ${{ (github.event_name == 'push' && '30') || (github.event_name == 'workflow_dispatch' && inputs.version_count) || '5' }}
|
|
run: |
|
|
VERSIONS=$(gh release list \
|
|
--repo gastownhall/beads \
|
|
--limit "$VERSION_COUNT" \
|
|
--json tagName \
|
|
--jq '[.[].tagName]')
|
|
echo "matrix=$VERSIONS" >> "$GITHUB_OUTPUT"
|
|
echo "Testing versions: $VERSIONS"
|