Skip to content

[pull] main from PrefectHQ:main #300

[pull] main from PrefectHQ:main

[pull] main from PrefectHQ:main #300

name: Markdown tests
env:
# enable colored output
# https://github.com/pytest-dev/pytest/issues/7443
PY_COLORS: 1
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/markdown-tests.yaml
- "docs/**"
- requirements-client.txt
- requirements-dev.txt
- requirements-markdown-tests.txt
- requirements.txt
- setup.cfg
- Dockerfile
push:
branches:
- main
paths:
- .github/workflows/markdown-tests.yaml
- "src/prefect/**/*.py"
- "tests/**/*.py"
- requirements-client.txt
- requirements-dev.txt
- requirements-markdown-tests.txt
- requirements.txt
- setup.cfg
- Dockerfile
permissions:
contents: read
# 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.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
run-markdown-tests:
runs-on:
group: oss-larger-runners
name: markdown:${{ matrix.python-version }}, ${{ matrix.database }}
strategy:
matrix:
database:
- "sqlite"
python-version:
- "3.9"
fail-fast: true
timeout-minutes: 15
steps:
- name: Display current test matrix
run: echo '${{ toJSON(matrix) }}'
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: setup_python
with:
python-version: ${{ matrix.python-version }}
- name: UV Cache
# Manually cache the uv cache directory
# until setup-python supports it:
# https://github.com/actions/setup-python/issues/822
uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: uvcache-markdown-tests-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-client.txt', 'requirements.txt', 'requirements-dev.txt', 'requirements-markdown.txt') }}
- name: Install packages
run: |
python -m pip install -U uv
uv pip install --upgrade --system -e '.[dev]'
uv pip install --upgrade --system -r requirements-markdown-tests.txt
uv pip uninstall --system pytest-benchmark
- name: Start server
run: |
PREFECT_HOME=$(pwd) prefect server start&
PREFECT_API_URL="http://127.0.0.1:4200/api" ./scripts/wait-for-server.py
- name: Run tests
run: >
PREFECT_API_URL="http://127.0.0.1:4200/api" pytest docs/ --markdown-docs -m markdown-docs
--numprocesses auto
--maxprocesses 6