Repository navigation
106 lines (93 loc) · 3.3 KB
/
Copy pathsetup-stackql-mcp-test.yml
File metadata and controls
106 lines (93 loc) · 3.3 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
name: 'setup stackql mcp test'
on:
push:
branches:
- main
- 'develop-**'
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
mcp-test-matrix:
name: ${{ matrix.os }} (version ${{ matrix.version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Both the floating 'latest' and the currently pinned release. The
# github null_auth fixture needs no secrets, so this runs credential-free.
version: [latest, 0.10.500]
include:
- os: windows-11-arm
version: latest
- os: windows-11-arm
version: 0.12.778
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
architecture: ${{ matrix.os == 'windows-11-arm' && 'x64' || '' }}
- name: Test installer
run: python -m unittest discover -s tests -v
- name: Setup StackQL MCP
id: setup
uses: ./
with:
version: ${{ matrix.version }}
- name: Assert mcp-config is valid JSON
env:
MCP_CONFIG: ${{ steps.setup.outputs.mcp-config }}
run: |
echo "$MCP_CONFIG" | python -m json.tool > /dev/null
echo "mcp-config is valid JSON"
- name: Assert mcp-config-file exists and matches mcp-config
env:
MCP_CONFIG: ${{ steps.setup.outputs.mcp-config }}
MCP_CONFIG_FILE: ${{ steps.setup.outputs.mcp-config-file }}
run: |
test -f "$MCP_CONFIG_FILE" || { echo "mcp-config-file missing: $MCP_CONFIG_FILE"; exit 1; }
python - <<'EOF'
import json, os
on_disk = json.load(open(os.environ["MCP_CONFIG_FILE"], encoding="utf-8"))
as_string = json.loads(os.environ["MCP_CONFIG"])
assert on_disk == as_string, "mcp-config-file does not match mcp-config"
print("mcp-config-file exists and matches mcp-config")
EOF
- name: Assert binary-path exists and runs
env:
BIN: ${{ steps.setup.outputs.binary-path }}
run: |
test -x "$BIN" || { echo "binary-path is not executable: $BIN"; exit 1; }
"$BIN" --version
- name: Verify native Windows binary architecture
if: runner.os == 'Windows'
shell: pwsh
env:
BIN: ${{ steps.setup.outputs.binary-path }}
run: |
$bytes = [IO.File]::ReadAllBytes($env:BIN)
$pe = [BitConverter]::ToInt32($bytes, 0x3c)
$machine = [BitConverter]::ToUInt16($bytes, $pe + 4)
$expected = if ($env:RUNNER_ARCH -eq 'ARM64') { 0xaa64 } else { 0x8664 }
if ($machine -ne $expected) { throw 'Installed binary does not match runner architecture' }
- name: Smoke test via emitted mcp-config
env:
MCP_CONFIG: ${{ steps.setup.outputs.mcp-config }}
run: |
python - <<'EOF'
import importlib.util, json, os
cfg = json.loads(os.environ["MCP_CONFIG"])
server = cfg["mcpServers"]["stackql"]
spec = importlib.util.spec_from_file_location("smoke", "scripts/smoke-test.py")
smoke = importlib.util.module_from_spec(spec)
spec.loader.exec_module(smoke)
smoke.run_command([server["command"], *server["args"]])
EOF