|
| 1 | +# Docs conformance: diffs the hand-written Fern spec (fern/openapi.yml) |
| 2 | +# against the upstream OpenAI spec. Runs on PRs that touch the spec and |
| 3 | +# weekly to surface upstream drift. |
| 4 | + |
| 5 | +name: "API Conformance: Docs" |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - "fern/openapi.yml" |
| 11 | + - "scripts/openai_coverage.py" |
| 12 | + |
| 13 | + schedule: |
| 14 | + - cron: "23 9 * * 1" |
| 15 | + |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +env: |
| 22 | + OASDIFF_VERSION: "1.23.0" |
| 23 | + |
| 24 | +jobs: |
| 25 | + docs: |
| 26 | + name: fern/openapi.yml vs OpenAI spec |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 30 | + with: |
| 31 | + persist-credentials: false |
| 32 | + |
| 33 | + - name: Set up Python |
| 34 | + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 |
| 35 | + with: |
| 36 | + python-version: "3.12" |
| 37 | + |
| 38 | + - uses: ./.github/actions/setup-uv |
| 39 | + - run: uv sync --locked --group dev |
| 40 | + |
| 41 | + - name: Install oasdiff |
| 42 | + run: | |
| 43 | + go install github.com/oasdiff/oasdiff@v${{ env.OASDIFF_VERSION }} |
| 44 | + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH |
| 45 | +
|
| 46 | + - name: Check for breaking changes |
| 47 | + if: github.event_name == 'pull_request' |
| 48 | + run: uv run --locked python scripts/openai_coverage.py --fetch --check-breaking |
| 49 | + |
| 50 | + - name: Check conformance |
| 51 | + run: uv run --locked python scripts/openai_coverage.py --fetch |
| 52 | + |
| 53 | + - name: Weekly drift summary |
| 54 | + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' |
| 55 | + run: | |
| 56 | + { |
| 57 | + echo "## Docs Conformance — Weekly Drift Check" |
| 58 | + echo '```' |
| 59 | + uv run --locked python scripts/openai_coverage.py --fetch 2>&1 || true |
| 60 | + echo '```' |
| 61 | + } >> "$GITHUB_STEP_SUMMARY" |
0 commit comments