Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,19 @@ jobs:
uv run ruff format --check src tests
- name: Mypy (best-effort, non-blocking)
run: uv run mypy src || true
- name: Pytest
- name: Pytest (with coverage)
run: |
uv run pytest -q \
-m "not network" \
--ignore=tests/integration \
--maxfail=5
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: backend
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

frontend:
name: Frontend (lint + build + test)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<p align="center">
<a href="LICENSE"><img alt="License" src="https://img.shields.io/badge/license-PolyForm--Noncommercial--1.0.0-blue.svg" /></a>
<a href="COMMERCIAL_LICENSE.md"><img alt="Commercial" src="https://img.shields.io/badge/commercial-on%20request-orange.svg" /></a>
<a href=".github/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/badge/CI-GitHub%20Actions-success" /></a>
<a href="https://github.com/codexofc/cigarspace/releases"><img alt="Release" src="https://img.shields.io/badge/release-v1.0.0-brightgreen" /></a>
<a href="https://github.com/codexofc/cigarspace/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/codexofc/cigarspace/actions/workflows/ci.yml/badge.svg?branch=main" /></a>
<a href="https://codecov.io/gh/codexofc/cigarspace"><img alt="Coverage" src="https://codecov.io/gh/codexofc/cigarspace/branch/main/graph/badge.svg" /></a>
<a href="https://github.com/codexofc/cigarspace/releases"><img alt="Release" src="https://img.shields.io/github/v/release/codexofc/cigarspace?display_name=tag&sort=semver" /></a>
<img alt="Python" src="https://img.shields.io/badge/python-3.12-blue" />
<img alt="Node" src="https://img.shields.io/badge/node-20-green" />
<img alt="Postgres" src="https://img.shields.io/badge/postgres-16%2Bpgvector-336791" />
Expand Down
41 changes: 41 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Codecov configuration.
# See https://docs.codecov.com/docs/codecov-yaml for the full reference.

coverage:
# Round to one decimal in the UI / PR comments.
precision: 1
round: down
range: "70...95"

status:
project:
default:
# Project-wide gate matches the local pytest gate.
target: 82%
threshold: 1% # tolerate a 1-point drop before failing
if_ci_failed: error
patch:
default:
# New code introduced in a PR must itself be well-tested.
target: 80%
threshold: 2%
if_ci_failed: error

# Don't fail the upload if the same commit is processed twice.
parsers:
v1:
include_full_missed_files: true

ignore:
- "src/**/__init__.py"
- "src/presentation/cli/__main__.py"
- "tests/**"
- "migrations/**"
- "docs/**"

comment:
layout: "header, diff, flags, components, files, footer"
behavior: default
require_changes: false
require_base: false
require_head: true
31 changes: 30 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ dev = [
"respx>=0.21,<1",
"ruff>=0.4,<1",
"mypy>=1.10,<2",
"pytest-cov>=7.1.0",
]

[build-system]
Expand Down Expand Up @@ -127,9 +128,37 @@ asyncio_default_fixture_loop_scope = "session"
asyncio_default_test_loop_scope = "session"
pythonpath = ["src"]
testpaths = ["tests"]
addopts = ["-ra", "--strict-markers", "--strict-config"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=src",
"--cov-report=term-missing:skip-covered",
"--cov-report=xml",
"--cov-fail-under=82",
]
markers = [
"integration: tests requiring live services (PG, Redis)",
"e2e: end-to-end pipeline tests",
"network: tests that hit real remote hosts (kept out of default runs)",
]

[tool.coverage.run]
source = ["src"]
branch = false
omit = [
"src/**/__init__.py",
"src/presentation/cli/__main__.py",
]

[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@(abc\\.)?abstractmethod",
"\\.\\.\\.",
"pragma: no cover",
]
show_missing = true
skip_covered = true
precision = 1
40 changes: 40 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading