-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (124 loc) · 4.87 KB
/
Copy pathci.yml
File metadata and controls
147 lines (124 loc) · 4.87 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
run: python -m pip install --upgrade uv
- name: Install dependencies (with dev extras)
run: uv sync --extra dev --frozen
- name: Ruff check
run: uv run ruff check src tests scripts td_component
- name: Ruff format check
# v1.4.4: flipped from continue-on-error to enforcing after the
# mechanical `ruff format` pass landed (commit e9ca15e). If this
# step fails, run `uv run ruff format .` locally, commit, and
# add the commit hash to .git-blame-ignore-revs if it's purely
# mechanical.
run: uv run ruff format --check src tests scripts td_component
- name: Version drift check
run: uv run python scripts/check_versions.py
- name: .tox freshness check
run: uv run python scripts/check_tox_freshness.py
# Static script invocation — no GitHub event data consumed, so no
# injection risk from user-controlled inputs. The script greps tracked
# files for /Users/<name>/ and C:\Users\<name>\ patterns.
- name: Personal path leak check
run: bash scripts/check_no_personal_paths.sh
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: python -m pip install --upgrade uv
- name: Install dependencies
run: uv sync --extra dev --frozen
- name: Run tests with coverage
run: uv run pytest tests/ -q --cov=src/td_mcp --cov-report=term --cov-report=xml
- name: Upload coverage report
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v6
with:
name: coverage-xml
path: coverage.xml
- name: Run registry smoke check
run: uv run python scripts/smoke_mcp_registry.py
- name: Run doctor (offline mode)
run: uv run tdpilot-dpsk4 doctor --json --skip-td-check
- name: Validate release-gate checker
run: |
cat > /tmp/bench.json <<'JSON'
{
"benchmarks": {
"td_get_nodes": {"latency_ms": {"p95": 250.0}, "error_rate_pct": 0.0},
"td_get_params": {"latency_ms": {"p95": 200.0}, "error_rate_pct": 0.0},
"td_set_params": {"latency_ms": {"p95": 150.0}, "error_rate_pct": 0.0},
"td_capture_and_analyze_capture_only": {"latency_ms": {"p95": 600.0}, "error_rate_pct": 0.0}
}
}
JSON
uv run python scripts/check_release_gates.py --bench-report /tmp/bench.json --require-complete
- name: Validate bundle integrity
run: |
uv run python -c "
import json, sys
from td_mcp import __version__, TOX_FILENAME
manifest = json.load(open('mcp/manifest.json'))
errors = []
if manifest['version'] != __version__:
errors.append(f'manifest version {manifest[\"version\"]} != {__version__}')
expected_tox = f'td_component/{TOX_FILENAME}'
if manifest['artifacts']['td_component_tox'] != expected_tox:
errors.append(f'manifest tox {manifest[\"artifacts\"][\"td_component_tox\"]} != {expected_tox}')
if errors:
print('\n'.join(errors)); sys.exit(1)
print('Bundle integrity OK')
"
- name: Ensure no legacy repo/path drift
run: |
if rg -n "TDPilot-v1\.0|TDPilot-claude-refactor|mcp_server_codex" README.md pyproject.toml src npm install.sh install.ps1 mcp scripts td_component setup_mcp_in_td.py plugin_README.md; then
echo "Legacy references found."
exit 1
fi
- name: Package build smoke (wheel + npm pack + plugin zip)
run: bash scripts/check_package_builds.sh --cleanup
install-parse:
name: Install script parse-check (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Bash install script syntax-check (macOS)
if: runner.os == 'macOS'
run: bash -n install.sh
- name: PowerShell install script parse-check (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$script = Get-Content install.ps1 -Raw
$null = [ScriptBlock]::Create($script)
Write-Host "install.ps1 parses cleanly"