openapi generated client
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 30s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 32s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 32s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Failing after 52s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 30s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 34s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Successful in 1m28s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Successful in 1m35s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Successful in 1m30s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 31s
Python package / build (pip list, 3.13) (pull_request) Successful in 33s
Python package / build (pip list, 3.14) (pull_request) Successful in 31s
Python package / build (pytest --ignore=tests/integration, 3.12.3) (pull_request) Successful in 43s
Python package / build (pytest --ignore=tests/integration, 3.13) (pull_request) Successful in 46s
Python package / build (pytest --ignore=tests/integration, 3.14) (pull_request) Successful in 42s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.12.3) (pull_request) Successful in 29s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.13) (pull_request) Successful in 29s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.14) (pull_request) Successful in 28s
Verify OpenAPI types / Verify generated TypeScript matches committed types (pull_request) Successful in 3m15s

This commit is contained in:
2026-04-14 22:06:35 +02:00
parent a453e20f49
commit fab47acc95
2 changed files with 78 additions and 0 deletions
@@ -0,0 +1,44 @@
name: Generate OpenAPI JavaScript client
on:
push:
paths:
- 'openapi.yaml'
- '.github/workflows/generate-openapi-client.yml'
workflow_dispatch: {}
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java (required by OpenAPI Generator)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Generate JavaScript client from OpenAPI
uses: openapitools/openapi-generator-cli@v2.5.0
with:
arguments: generate -i openapi.yaml -g javascript -o openapi-client-ts --additional-properties=useES6=true,projectName=brencher-openapi
- name: Generate Python FastAPI server from OpenAPI
uses: openapitools/openapi-generator-cli@v2.5.0
with:
arguments: generate -i openapi.yaml -g python-fastapi -o openapi-server-py --additional-properties=projectName=brencher-python-server,packageName=brencher_server
# docker run --rm -v "$PWD":/local openapitools/openapi-generator-cli generate -i /local/openapi.yaml -g python-fastapi -o /local/openapi-server-py --additional-properties=projectName=brencher-python-server,packageName=brencher_server
# docker run --rm -v "$PWD":/local openapitools/openapi-generator-cli generate -i /local/openapi.yaml -g javascript -o /local/openapi-client-ts --additional-properties=useES6=true,projectName=brencher-openapi
# - name: Commit generated client
# uses: EndBug/add-and-commit@v9
# with:
# author_name: github-actions
# author_email: actions@github.com
# message: "chore: regenerate OpenAPI JavaScript client"
# add: openapi-client-ts openapi-server-py
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,34 @@
name: Verify OpenAPI types
on:
pull_request:
push:
branches: [ main ]
jobs:
verify-openapi-types:
name: Verify generated TypeScript matches committed types
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Generate types from OpenAPI
run: |
set -euo pipefail
npx --yes openapi-typescript openapi.yaml --output generated-openapi-types.ts
- name: Show diff and fail if different
run: |
set -euo pipefail
if ! command -v diff >/dev/null 2>&1; then echo "diff not found" && exit 2; fi
echo "Comparing generated types to frontend/src/types/api.ts"
if ! diff -u frontend/src/types/api.ts generated-openapi-types.ts; then
echo "OpenAPI types are out of date. Regenerate with: npx openapi-typescript openapi.yaml --output frontend/src/types/api.ts";
exit 1;
fi