-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (74 loc) · 2.5 KB
/
Copy pathsetup-stackql-mcp-test.yml
File metadata and controls
85 lines (74 loc) · 2.5 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
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]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- 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: 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