Skip to content

ci: fold the docs drift assertion into the codegen check #26

ci: fold the docs drift assertion into the codegen check

ci: fold the docs drift assertion into the codegen check #26

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
- name: Install Kiota
run: |
dotnet tool install --global Microsoft.OpenApi.Kiota --version 1.32.2
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
# Hermetic: regenerates from the committed spec, so this verifies that the committed
# generated code still reproduces from it, with no network dependency. Refreshing the
# spec itself is the release workflow's job. `generate` also runs sync-docs (see
# tools/RoxyDevTools/Program.cs), so the docs and the compiled example guard are
# asserted in the same diff rather than by a second identical run.
- name: Codegen drift check
env:
ROXYAPI_SPEC_FILE: specs/openapi.json
run: |
dotnet run --project tools/RoxyDevTools -- generate
git diff --exit-code -- specs/openapi.json src/Generated README.md AGENTS.md docs/llms-full.txt tests/RoxyApi.Tests/Generated \
|| { echo 'codegen drift: run "dotnet run --project tools/RoxyDevTools -- generate" and commit the result'; exit 1; }
- name: Format check
run: dotnet format --verify-no-changes --exclude src/Generated/
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test -c Release --no-build
env:
ROXY_API_KEY: ${{ secrets.ROXY_API_KEY }}