Repository navigation
chore: import datetime as dt for ruff 0.17 (#49) #96
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: extractions/setup-just@v4 | |
| - uses: astral-sh/setup-uv@v8.2.0 | |
| - run: uv python install 3.14 | |
| - run: uv python pin 3.14 | |
| - run: | | |
| uv sync --all-extras --all-groups --no-install-project | |
| uv run ruff format . --check | |
| uv run ruff check . --no-fix | |
| uv run ty check | |
| - run: just adr-check | |
| pytest: | |
| runs-on: ubuntu-latest | |
| name: pytest (${{ matrix.name }}) | |
| strategy: | |
| # Without this a failing app suite cancels the migration leg, collapsing two | |
| # independent signals back into one. | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: app | |
| run: uv run alembic upgrade head && uv run pytest . | |
| # No `alembic upgrade` first: pytest-alembic drives the schema itself, and running | |
| # it against an empty database is what makes test_upgrade mean anything. | |
| - name: migrations | |
| run: uv run pytest tests/migrations --override-ini=addopts= | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: postgres | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_USER: postgres | |
| ports: ["5432:5432"] | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v8.2.0 | |
| - run: uv python install 3.14 | |
| - run: uv python pin 3.14 | |
| - run: | | |
| uv sync --all-extras --all-groups --no-install-project | |
| ${{ matrix.run }} | |
| env: | |
| SERVICE_ENVIRONMENT: ci | |
| PYTHONDONTWRITEBYTECODE: 1 | |
| PYTHONUNBUFFERED: 1 | |
| DB_DSN: postgresql+asyncpg://postgres:password@127.0.0.1/postgres | |
| # Must match docker-compose.yml and stay >= 32 bytes: PyJWT warns below the | |
| # HS256 minimum (RFC 7518 3.2), and filterwarnings = ["error"] makes that fatal. | |
| JWT_SECRET: insecure-ci-secret-do-not-use-in-prod | |
| links: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # --offline blocks network requests and excludes every external URL, so this gate | |
| # is deterministic: it fails only on a relative link or file path a diff broke. | |
| # Tag-pinned and cross-repo URLs do not match the --remap pattern and stay | |
| # excluded: they point at trees this checkout does not have. | |
| - name: Check local links | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| args: >- | |
| --offline | |
| --no-progress | |
| --remap | |
| 'https://github\.com/${{ github.repository }}/(?:blob|tree)/main/(.*) file://${{ github.workspace }}/$1' | |
| '**/*.md' |