-
Notifications
You must be signed in to change notification settings - Fork 302
154 lines (131 loc) · 4.67 KB
/
Copy pathci.yml
File metadata and controls
154 lines (131 loc) · 4.67 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
148
149
150
151
152
153
154
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
lint-and-typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --group dev
- name: Run linters
run: |
set +e
make lint > lint_output.txt 2>&1
LINT_EXIT=$?
set -e
echo "## Lint Results" >> $GITHUB_STEP_SUMMARY
if [ $LINT_EXIT -eq 0 ]; then
echo "✅ No linting errors found" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Linting errors found:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat lint_output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
- name: Run type checker
run: |
set +e
make typecheck > typecheck_output.txt 2>&1
TYPECHECK_EXIT=$?
set -e
echo "## Type Check Results" >> $GITHUB_STEP_SUMMARY
if [ $TYPECHECK_EXIT -eq 0 ]; then
echo "✅ No type errors found" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Type errors found:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat typecheck_output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
test:
needs: lint-and-typecheck
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-path:
- tests/adapters
- tests/apps
- tests/auth
- tests/chat
- tests/cli
- tests/commands
- tests/config
- tests/context
- tests/core
- tests/display
- tests/interactive
- tests/memory
- tests/model_management
- tests/tools
- tests/utils
- tests/test_command_consistency.py tests/test_mcp_cli_init.py tests/test_mcp_cli_main_entry.py
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --group dev
- name: Run tests
run: uv run pytest --cov=src --cov-report= ${{ matrix.test-path }}
- name: Rename coverage file
run: mv .coverage ".coverage.${{ strategy.job-index }}"
- name: Upload coverage artifact
uses: actions/upload-artifact@v6
with:
name: coverage-${{ strategy.job-index }}
path: .coverage.${{ strategy.job-index }}
include-hidden-files: true
if-no-files-found: error
report-coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv venv
uv pip install coverage[toml]
- name: Download coverage reports
uses: actions/download-artifact@v7
with:
pattern: coverage-*
merge-multiple: true
- name: Combine coverage reports
run: uv run coverage combine
- name: Generate coverage summary
run: |
echo "## Code Coverage Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
uv run coverage report -m --fail-under=60 >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY