Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install dependencies
run: uv sync --extra dev

- name: Run tests
run: uv run python -m pytest tests/ --no-cov -q

- name: Run tests with coverage (3.11 only)
if: matrix.python-version == '3.11'
run: uv run python -m pytest tests/ --cov=fastapi_correlation --cov-report=xml -q

- name: Upload coverage
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: coverage.xml
fail_ci_if_error: false

lint:
name: Lint & type check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.11"
enable-cache: true

- name: Install dependencies
run: uv sync --extra dev

- name: Ruff lint
run: uv run ruff check fastapi_correlation/ tests/

- name: Ruff format check
run: uv run ruff format --check fastapi_correlation/ tests/

- name: mypy
run: uv run python -m mypy fastapi_correlation/
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to PyPI

on:
push:
tags:
- "v*.*.*"

jobs:
publish:
name: Build and publish
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # required for trusted publishing

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.11"
enable-cache: true

- name: Install dependencies
run: uv sync --extra dev

- name: Run tests
run: uv run python -m pytest tests/ --no-cov -q

- name: Build
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading