Skip to content

Commit ae45457

Browse files
committed
chore: add local Makefile mirroring CI job steps
ci-lint/ci-rust/ci-test/ci-quality match the corresponding ci.yml jobs so `make ci` reproduces the pipeline locally.
1 parent 384173b commit ae45457

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
PYTHON ?= python3
2+
3+
.PHONY: ci ci-lint ci-rust ci-test ci-quality
4+
5+
ci: ci-lint ci-rust ci-test ci-quality
6+
7+
ci-lint:
8+
$(PYTHON) -m pip install --upgrade pip
9+
pip install pre-commit
10+
pip install -e ".[dev]"
11+
pre-commit run --all-files
12+
ruff check src tests
13+
black --check src tests
14+
mypy src
15+
16+
ci-rust:
17+
cd diffctx && DIFFCTX_YAML_CASES_LIMIT="20" cargo test --lib
18+
cd diffctx && cargo build --release
19+
cd diffctx && DIFFCTX_YAML_CASES_LIMIT="20" cargo test --release --test yaml_cases
20+
cd diffctx && ./target/release/diffctx-test || true
21+
22+
ci-test:
23+
$(PYTHON) -m pip install --upgrade pip
24+
pip install "maturin>=1.10,<1.11"
25+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY="1" pip install -e ".[dev,full,mcp]" --no-build-isolation
26+
pytest -v --cov=src/diffctx --cov-report=xml \
27+
--cov-report=term-missing --cov-branch --junitxml=test-results.xml
28+
coverage report --fail-under=40
29+
30+
ci-quality:
31+
$(PYTHON) -m pip install --upgrade pip
32+
pip install -e ".[dev]"
33+
radon cc src/diffctx/ --min B --show-complexity --total-average
34+
radon mi src/diffctx/ --min B --show
35+
radon cc src/diffctx/ --min C --total-average || \
36+
(echo "High complexity detected" && exit 1)
37+
lint-imports

0 commit comments

Comments
 (0)