Skip to content

Fix generators, regenerate SDKs, add drift checks and CI gates #10

Fix generators, regenerate SDKs, add drift checks and CI gates

Fix generators, regenerate SDKs, add drift checks and CI gates #10

Workflow file for this run

name: Test
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
smithy:
name: Smithy Verify
uses: ./.github/workflows/smithy-verify.yml
test-go:
name: Go
runs-on: ubuntu-latest
needs: smithy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Check service drift
run: ./scripts/check-service-drift.sh
- name: Check type freshness
run: |
cd go && go generate ./...
cd ..
test -z "$(git status --porcelain go/pkg/generated/)" || \
(echo "ERROR: Go generated types are stale. Run 'cd go && go generate ./...'" && git status --porcelain go/pkg/generated/ && exit 1)
- name: Test
run: cd go && go test ./pkg/fizzy/... -count=1 -race -coverprofile=coverage.out
- name: Coverage
run: |
cd go
COVERAGE=$(go tool cover -func=coverage.out | tail -1 | awk '{print $3}' | tr -d '%')
echo "Coverage: ${COVERAGE}%"
if (( $(echo "$COVERAGE < 25" | bc -l) )); then
echo "Coverage below 25% threshold"
exit 1
fi
test-typescript:
name: TypeScript
runs-on: ubuntu-latest
needs: smithy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install
run: cd typescript && npm ci
- name: Check service drift
run: ./scripts/check-ts-service-drift.sh
- name: Check service freshness
run: |
cd typescript && npx tsx scripts/generate-services.ts
cd ..
test -z "$(git status --porcelain typescript/src/generated/services/)" || \
(echo "ERROR: TypeScript generated services are stale. Run 'make ts-generate-services'" && git status --porcelain typescript/src/generated/services/ && exit 1)
- name: Lint
run: cd typescript && npm run lint
- name: Typecheck
run: cd typescript && npm run typecheck
- name: Test
run: cd typescript && npm test
- name: Build
run: cd typescript && npm run build
- name: Verify root pack
run: npm pack --dry-run
test-ruby:
name: Ruby (${{ matrix.ruby }})
runs-on: ubuntu-latest
needs: smithy
strategy:
matrix:
ruby: ['3.2', '3.3', '3.4', '4.0', 'head']
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
working-directory: ruby
- name: Check service drift
if: matrix.ruby == '3.3'
run: ./scripts/check-rb-service-drift.sh
- name: Check service freshness
if: matrix.ruby == '3.3'
run: |
ruby ruby/scripts/generate-services.rb
test -z "$(git status --porcelain ruby/lib/fizzy/generated/services/)" || \
(echo "ERROR: Ruby generated services are stale. Run 'make rb-generate-services'" && git status --porcelain ruby/lib/fizzy/generated/services/ && exit 1)
- name: Lint
if: matrix.ruby == '3.3'
run: cd ruby && bundle exec rubocop
- name: Test
run: cd ruby && bundle exec rake test
test-swift:
name: Swift
runs-on: macos-15
needs: smithy
steps:
- uses: actions/checkout@v4
- name: Build
run: cd swift && swift build
- name: Check service drift
run: ./scripts/check-swift-service-drift.sh
- name: Check service freshness
run: |
cd swift && swift run FizzyGenerator --openapi ../openapi.json --behavior ../behavior-model.json --output Sources/Fizzy/Generated
cd ..
test -z "$(git status --porcelain swift/Sources/Fizzy/Generated/)" || \
(echo "ERROR: Swift generated services are stale. Run 'make swift-generate'" && git status --porcelain swift/Sources/Fizzy/Generated/ && exit 1)
- name: Test
run: cd swift && swift test
test-kotlin:
name: Kotlin
runs-on: ubuntu-latest
needs: smithy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: '17'
- name: Build
run: cd kotlin && ./gradlew :fizzy-sdk:compileKotlinJvm
- name: Check service drift
run: ./scripts/check-kotlin-service-drift.sh
- name: Check service freshness
run: |
cd kotlin && ./gradlew :generator:run
cd ..
test -z "$(git status --porcelain kotlin/sdk/src/commonMain/kotlin/com/basecamp/fizzy/generated/)" || \
(echo "ERROR: Kotlin generated services are stale. Run 'make kt-generate-services'" && git status --porcelain kotlin/sdk/src/commonMain/kotlin/com/basecamp/fizzy/generated/ && exit 1)
rubric-check:
name: Rubric Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check rubric audit
run: make audit-check