Repository navigation
101 lines (85 loc) · 3.47 KB
/
Copy pathci.yml
File metadata and controls
101 lines (85 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
pull_request:
branches: [develop]
push:
branches: [develop]
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set git config for tests
run: git config --global user.email "ci@codewiki.test" && git config --global user.name "ci"
- name: Install dependencies
run: uv sync --frozen
- name: Run tests
run: uv run pytest --cov=codewiki --cov-report=term-missing -p no:cacheprovider tests/ -q
# The MCP handler contract lives in this standalone script (126 checks over
# fake-repo fixtures); pytest never collects it because its entrypoint is
# main(), not test_* functions. Run it so handler regressions are visible,
# but non-blocking: 6 of its assertions have drifted behind deliberate
# product changes (ADR-0013 stable-requires-reason, batch_ingest results →
# report_file, doc_writer drops `components` for component_count,
# lint check count 16→22, raw/sources OKF conformance errors, get_prompt
# output_dir-only addressing). Triage them, then flip to blocking.
# tests/smoke_test_mcp.py stays out of CI entirely: it passes this repo's
# real path to analyze_repo, whose output_dir is now derived from repo_path
# (analysis.py:57-64), so running it writes into the live repowiki/.
- name: Run MCP handler regression suite
continue-on-error: true
run: uv run python tests/okf_regression_test.py
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
- name: Collect changed Python files
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PUSH_BASE_SHA: ${{ github.event.before }}
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
diff_range="${PR_BASE_SHA}...${PR_HEAD_SHA}"
else
diff_range="${PUSH_BASE_SHA}..${GITHUB_SHA}"
fi
git diff --name-only --diff-filter=ACMR -z "$diff_range" -- '*.py' \
> "$RUNNER_TEMP/changed-python-files"
- name: Ruff check changed files
run: |
xargs -0 -r uv run ruff check --output-format=github \
< "$RUNNER_TEMP/changed-python-files"
- name: Ruff format check changed files
run: |
xargs -0 -r uv run ruff format --check \
< "$RUNNER_TEMP/changed-python-files"
# Phase-in mypy: only check changed Python files so existing type debt
# does not block every PR. Full-project baseline has 519 errors plus 137
# notes across 106 files (see .qoder/mypy-baseline.txt); tighten once the
# baseline is cleaned up.
# continue-on-error: changed files may still carry legacy errors, so
# report first and flip to blocking after the debt is burned down.
- name: Mypy type check changed files
continue-on-error: true
run: |
xargs -0 -r uv run python -m mypy --follow-imports=silent \
< "$RUNNER_TEMP/changed-python-files"