mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-03-01 17:00:48 +01:00
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 5 to 7. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v5...v7) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
101 lines
2.2 KiB
YAML
101 lines
2.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint (Ruff)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.13
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --extra dev
|
|
|
|
- name: Run Ruff linter
|
|
run: uv run ruff check .
|
|
|
|
- name: Run Ruff formatter check
|
|
run: uv run ruff format --check .
|
|
|
|
typecheck:
|
|
name: Type Check (ty)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.13
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --extra dev
|
|
|
|
- name: Run ty
|
|
run: uv run ty check
|
|
|
|
test:
|
|
name: Test (Python ${{ matrix.python-version }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.11", "3.12", "3.13"]
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:18
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: test_db
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
run: uv python install ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --extra dev
|
|
|
|
- name: Run tests with coverage
|
|
env:
|
|
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/test_db
|
|
run: |
|
|
uv run pytest --cov --cov-report=xml --cov-report=term-missing
|
|
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.python-version == '3.13'
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./coverage.xml
|
|
fail_ci_if_error: false
|