-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 1.93 KB
/
Copy pathcoverage.yml
File metadata and controls
79 lines (65 loc) · 1.93 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
name: 📈 Coverage gate
# Batch P1-B — enforces the >= 80 % coverage threshold declared in
# pyproject.toml [tool.coverage.report]. Runs on every PR + push to main.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
pull-requests: write
concurrency:
group: coverage-${{ github.ref }}
cancel-in-progress: true
jobs:
coverage:
name: 🧪 Pytest + coverage
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🐍 Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: 🐍 Set up Python 3.11
run: uv python install 3.11
- name: 📦 Install project + dev extras
run: |
uv venv
uv pip install -e ".[dev]"
- name: ⚡ Warm bytecode cache
run: uv run python -m compileall -q gitpilot tests || true
- name: 🔎 Strict type-check (Batch P1-C gated modules)
run: uv run mypy --config-file mypy.ini
- name: 🧪 Run tests with coverage
env:
GITPILOT_LITE_MODE: "0"
PYTHONWARNINGS: "ignore::RuntimeWarning"
run: |
TMP_CFG="$(mktemp -d)"
GITPILOT_CONFIG_DIR="$TMP_CFG" uv run pytest \
--cov \
--cov-report=term-missing \
--cov-report=xml \
--cov-report=html
rm -rf "$TMP_CFG"
- name: 📤 Upload coverage HTML artefact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: htmlcov/
retention-days: 7
- name: 📤 Upload coverage XML artefact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
retention-days: 7