Migrate to pyproject.toml
#5051
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: CodSpeed Benchmarks | |
env: | |
PY_COLORS: 1 | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/codspeed-benchmarks.yaml | |
- .github/workflows/python-tests.yaml | |
- "src/prefect/**/*.py" | |
- requirements.txt | |
- requirements-dev.txt | |
- setup.cfg | |
- Dockerfile | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
run-benchmarks: | |
name: Benchmark | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: "3.12" | |
enable-cache: true | |
- name: Install the project | |
run: uv sync --group benchmark --compile-bytecode | |
- name: Start server | |
run: | | |
PREFECT_HOME=$(pwd) uv run prefect server start& | |
PREFECT_API_URL="http://127.0.0.1:4200/api" ./scripts/wait-for-server.py | |
# TODO: Replace `wait-for-server` with dedicated command | |
# https://github.com/PrefectHQ/prefect/issues/6990 | |
- name: Run benchmarks | |
uses: CodSpeedHQ/action@v3 | |
env: | |
PREFECT_API_URL: "http://127.0.0.1:4200/api" | |
with: | |
run: > | |
uv run pytest | |
benches/bench_import.py | |
benches/bench_tasks.py | |
benches/bench_flows.py::bench_flow_decorator | |
benches/bench_flows.py::bench_flow_call | |
--codspeed | |
--numprocesses auto | |
--dist worksteal | |
-vv |