-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from PrefectHQ/run-in-ci
Run compatibility tests in CI
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
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 |