Skip to content

Go SDK

Go SDK #32

Workflow file for this run

name: Go SDK
on:
push:
branches: [ main, develop ]
paths:
- 'sdk/go/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/sdk-go.yml'
pull_request:
branches: [ main, develop ]
paths:
- 'sdk/go/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/sdk-go.yml'
schedule:
- cron: '0 2 * * *'
permissions:
contents: read
jobs:
build-and-test:
name: Go SDK Build & Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build
run: make sdk-go-build
- name: Test
run: make sdk-go-test
check-drift:
name: Check Generated Code Drift
runs-on: ubuntu-latest
permissions:
contents: read
# Only run drift check when openapi.json changes
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install ogen
run: go install github.com/ogen-go/ogen/cmd/ogen@v1.19.0
- name: Regenerate SDK
run: make sdk-go-generate
- name: Check for drift
run: |
if ! git diff --exit-code sdk/go/; then
echo "Generated Go SDK code is out of sync with openapi.json."
echo "Run 'make sdk-go-generate' and commit the result."
exit 1
fi