Skip to content

Commit

Permalink
Merge pull request #20 from PrefectHQ/run-in-ci
Browse files Browse the repository at this point in the history
Run compatibility tests in CI
  • Loading branch information
chrisguidry authored Apr 19, 2024
2 parents a8cd3f6 + 0b557c0 commit c0d0fff
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/api-compatibility-tests.yaml
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

0 comments on commit c0d0fff

Please sign in to comment.