Skip to content

test(e2e): updated scenarios with anthropic batch API tests and more #1999

test(e2e): updated scenarios with anthropic batch API tests and more

test(e2e): updated scenarios with anthropic batch API tests and more #1999

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel redundant runs on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GO_VERSION: "1.26.5"
# Restrict token permissions to minimum required
permissions:
contents: read
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
# v2.12+ ships a staticcheck that understands Go 1.26 control flow.
# v2.10's staticcheck mis-analyzed `if x == nil { t.Fatal() }` guards
# under GO_VERSION 1.26.4 and emitted false-positive SA5011 warnings.
version: v2.12
# Temporary workaround: config verification fetches the remote JSON schema and
# intermittently times out in CI before lint runs. Re-enable by 2026-04-01 once
# the schema fetch is reliable again; track in this PR/branch discussion.
verify: false
# Unit, E2E, integration, and contract suites share identical setup and
# differ only in the test command, so they run as one matrix.
go-tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: Unit Tests
cmd: make test-race
coverage: true
- name: E2E Tests
cmd: go test -v -tags=e2e -timeout=5m ./tests/e2e/...
- name: Integration Tests
cmd: go test -v -tags=integration -timeout=10m ./tests/integration/...
- name: Contract Replay Tests
cmd: go test -v -tags=contract -timeout=5m ./tests/contract/...
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run tests
run: ${{ matrix.cmd }}
- name: Upload coverage
if: matrix.coverage
uses: codecov/codecov-action@v7
with:
files: ./coverage.out
fail_ci_if_error: false
continue-on-error: true
test-dashboard:
name: Dashboard Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
- name: Run dashboard JavaScript tests
run: make test-dashboard
performance:
name: Performance Guard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run hot-path performance guard
# Thresholds are maintained in tests/perf/hotpath_test.go.
run: make perf-check
vulncheck:
name: Vulnerability Scan
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
# Scans the dependency graph against the Go vulnerability database,
# reporting only vulnerabilities reachable from our code. The second run
# covers the swagger-tagged production build (swagger_enabled.go), which
# the default tag set excludes. The tests/* suites behind e2e/integration/
# contract tags are deliberately skipped — they aren't in the shipped binary.
- name: Run govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@v1.3.0
govulncheck ./...
govulncheck -tags=swagger ./...
docs-validate:
name: Docs Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# To avoid possible issues related to missing libsecret binary on the runner runner
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
- name: Validate docs.json
run: npx mint validate
working-directory: docs
# Compiling the binary doesn't depend on tests passing, so this runs in
# parallel with the test jobs rather than gating behind them.
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Verify module integrity
run: go mod verify
- name: Build
run: go build -v ./cmd/gomodel