-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (54 loc) · 1.74 KB
/
ci.yml
File metadata and controls
68 lines (54 loc) · 1.74 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Cache virtual environment
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
venv-${{ runner.os }}-
- name: Create virtual environment
run: uv venv --allow-existing
- name: Install dependencies
run: uv pip install -e ".[dev]"
- name: Prune uv cache for CI
run: uv cache prune --ci
- name: Set up test cluster config
run: |
mkdir -p ~/.config/acp
cp clusters.yaml.example ~/.config/acp/clusters.yaml
- name: Run ruff (autofix, then verify)
run: |
uv run ruff check --fix .
uv run ruff format .
git diff --exit-code || (echo "ruff made changes — commit them locally before pushing" && exit 1)
# TODO: Enable mypy once type annotations are complete
# - name: Run mypy (type checking)
# run: uv run mypy src/mcp_acp
- name: Run tests with coverage
run: uv run pytest tests/ --cov=src/mcp_acp --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false