fix api body tests #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: API Compatibility | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/api-compatibility-tests.yaml | |
- "**/*.py" | |
push: | |
branches: | |
- main | |
# Limit concurrency by workflow/branch combination. | |
# | |
# For pull request builds, pushing additional changes to the | |
# branch will cancel prior in-progress and pending builds. | |
# | |
# For builds triggered on a branch push, additional changes | |
# will wait for prior builds to complete before starting. | |
# | |
# https://docs.github.com/en/actions/using-jobs/using-concurrency | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
compatibility-tests: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Versioneer only generates correct versions with a full fetch | |
fetch-depth: 0 | |
persist-credentials: false | |
submodules: true | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
id: setup_python | |
with: | |
python-version: 3.12 | |
- name: Install packages | |
run: | | |
python -m pip install -U uv | |
uv pip install --upgrade --system prefect 'pydantic>=2.4,<3' pytest | |
- name: Create Cloud OpenAPI JSON | |
run: curl https://api.prefect.cloud/api/openapi.json > cloud_schema.json | |
- name: Create OSS OpenAPI JSON | |
run: python -c "import json, sys; from prefect.server.api.server import create_app; openapi_schema = create_app().openapi(); json.dump(openapi_schema, sys.stdout)" > oss_schema.json | |
- name: Run API compatibility tests | |
run: pytest -vv |