-
Notifications
You must be signed in to change notification settings - Fork 1
226 lines (195 loc) · 6.29 KB
/
install-test.yml
File metadata and controls
226 lines (195 loc) · 6.29 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Installation Tests
on:
push:
branches: [main]
paths:
- 'quantum_code/**'
- 'pyproject.toml'
- 'Makefile'
- 'scripts/install.sh'
- '.github/workflows/install-test.yml'
pull_request:
branches: [main]
paths:
- 'quantum_code/**'
- 'pyproject.toml'
- 'Makefile'
- 'scripts/install.sh'
- '.github/workflows/install-test.yml'
release:
types: [published]
workflow_dispatch:
inputs:
test_pypi:
description: 'Test PyPI installation (requires package to be published)'
required: false
default: false
type: boolean
jobs:
# Test installation from git clone (pip install .)
test-git-install:
name: Git Install - ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package from source
run: |
python -m pip install --upgrade pip
pip install .
- name: Verify entry points exist (Unix)
if: runner.os != 'Windows'
run: |
which quantum
which quantum-server
which quantum-code
- name: Verify entry points exist (Windows)
if: runner.os == 'Windows'
run: |
where quantum
where quantum-server
where quantum-code
shell: cmd
- name: Test CLI commands
run: |
quantum --help
quantum-server --help
quantum-code --help
- name: Test Python import
run: |
python -c "import quantum_code; print(f'quantum_code imported successfully')"
python -c "from quantum_code.server import mcp; print(f'FastMCP server: {mcp}')"
python -c "from quantum_code.cli import main; print('CLI main imported')"
- name: Test package metadata
run: |
python -c "import importlib.metadata; v = importlib.metadata.version('quantum-code'); print(f'Version: {v}')"
# Test make install (developer setup from git clone)
test-make-install:
name: Make Install - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Skip Windows - install.sh is a bash script
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install Python 3.13
run: uv python install 3.13
- name: Run make install (non-interactive)
run: |
make install
env:
# CI=true triggers non-interactive mode in install.sh
CI: true
# Pin Python version (macOS has Python 3.14 which is unsupported)
UV_PYTHON: "3.13"
- name: Verify .venv was created
run: |
test -d .venv
echo "✓ .venv directory exists"
- name: Verify .env was created
run: |
test -f .env
echo "✓ .env file exists"
- name: Run make verify
run: |
make verify
- name: Verify CLI entry points
run: |
uv run python -m quantum_code.cli --help
uv run python -m quantum_code.server --help
# Test installation from PyPI (pip install quantum-code)
test-pypi-install:
name: PyPI Install - ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
# Only run on release or manual trigger with test_pypi=true
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.test_pypi)
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.11', '3.12', '3.13']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package from PyPI
run: |
python -m pip install --upgrade pip
pip install quantum-code
- name: Verify entry points exist (Unix)
if: runner.os != 'Windows'
run: |
which quantum
which quantum-server
which quantum-code
- name: Verify entry points exist (Windows)
if: runner.os == 'Windows'
run: |
where quantum
where quantum-server
where quantum-code
shell: cmd
- name: Test CLI commands
run: |
quantum --help
quantum-server --help
quantum-code --help
- name: Test Python import
run: |
python -c "import quantum_code; print(f'quantum_code imported successfully')"
python -c "from quantum_code.server import mcp; print(f'FastMCP server: {mcp}')"
python -c "from quantum_code.cli import main; print('CLI main imported')"
- name: Test package metadata
run: |
python -c "import importlib.metadata; v = importlib.metadata.version('quantum-code'); print(f'Version: {v}')"
# Test installation with uvx (recommended method for Claude Code users)
test-uvx-install:
name: uvx Install - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Only run on release or manual trigger with test_pypi=true
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.test_pypi)
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Test uvx quantum-code
run: |
uvx quantum-code --help
# Summary job for branch protection
install-test-summary:
name: Installation Tests Summary
runs-on: ubuntu-latest
needs: [test-git-install, test-make-install]
if: always()
steps:
- name: Check results
run: |
if [ "${{ needs.test-git-install.result }}" != "success" ]; then
echo "Git install tests failed"
exit 1
fi
if [ "${{ needs.test-make-install.result }}" != "success" ]; then
echo "Make install tests failed"
exit 1
fi
echo "All installation tests passed!"