mirror of
https://github.com/kennethreitz/responder.git
synced 2026-10-24 05:59:12 +00:00
78 lines
2.0 KiB
YAML
78 lines
2.0 KiB
YAML
name: "Tests"
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request: ~
|
|
workflow_dispatch:
|
|
|
|
# Cancel redundant in-progress jobs.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
|
|
test:
|
|
name: "Python ${{ matrix.python-version }}"
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: [
|
|
"3.11",
|
|
"3.12",
|
|
"3.13",
|
|
"3.14",
|
|
"3.14t",
|
|
"3.15",
|
|
"3.15t",
|
|
]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
activate-environment: true
|
|
enable-cache: true
|
|
cache-suffix: ${{ matrix.python-version }}
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install package
|
|
# Editable install so the cache never serves a stale pre-built wheel
|
|
# (per-version cache once shipped an old responder, masking errors.py fixes).
|
|
run: uv pip install -e '.[develop,test]'
|
|
|
|
- name: Install compiled optional backends (CPython versions with wheels)
|
|
# orjson and lupa (fakeredis[lua]) have no wheels for free-threaded
|
|
# CPython (3.14t/3.15t) or brand-new releases; building from source
|
|
# fails there. Install them only where wheels exist — the JSON and
|
|
# rate-limit tests that use them skip gracefully everywhere else.
|
|
if: ${{ contains(fromJSON('["3.11", "3.12", "3.13", "3.14"]'), matrix.python-version) }}
|
|
run: uv pip install orjson 'fakeredis[lua]'
|
|
|
|
- name: Run tests
|
|
run: pytest
|
|
|
|
release-guard:
|
|
name: "Release guard"
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
activate-environment: true
|
|
enable-cache: true
|
|
python-version: "3.12"
|
|
|
|
- name: Verify release metadata and artifacts
|
|
run: >
|
|
uv run --extra release --extra test
|
|
python scripts/release_check.py
|
|
--skip-tests --skip-lint --skip-types --skip-docs
|