81 lines
1.7 KiB
YAML
81 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint & typecheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup uv
|
|
uses: astral-sh/setup-uv@v8
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: uv.lock
|
|
|
|
- name: Install Python
|
|
run: uv python install
|
|
|
|
- name: Sync dev dependencies
|
|
run: uv sync --group dev --frozen
|
|
|
|
- name: Ruff check
|
|
run: uv run ruff check src tests
|
|
|
|
- name: Ruff format check
|
|
run: uv run ruff format --check src tests
|
|
|
|
- name: Mypy
|
|
run: uv run mypy src
|
|
|
|
test-unit:
|
|
name: Unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup uv
|
|
uses: astral-sh/setup-uv@v8
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: uv.lock
|
|
|
|
- name: Install Python
|
|
run: uv python install
|
|
|
|
- name: Sync dev dependencies
|
|
run: uv sync --group dev --frozen
|
|
|
|
- name: Run unit tests
|
|
run: uv run pytest -m "not integration"
|
|
|
|
test-integration:
|
|
name: Integration tests (testcontainers)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup uv
|
|
uses: astral-sh/setup-uv@v8
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: uv.lock
|
|
|
|
- name: Install Python
|
|
run: uv python install
|
|
|
|
- name: Sync dev dependencies
|
|
run: uv sync --group dev --frozen
|
|
|
|
- name: Run integration tests
|
|
run: uv run pytest -m integration
|