-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 2.25 KB
/
Copy pathci.yml
File metadata and controls
71 lines (58 loc) · 2.25 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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run codegen against production OpenAPI
run: bun run codegen
- name: Typecheck
run: bun run typecheck
- name: Lint
run: bun run lint
- name: Test
run: bun test
# The published artifact is dist/mna.js running on plain Node, which the
# unit tests never exercise. A dependency whose bundled output only breaks
# at runtime (e.g. a lazy `require` in a UMD build) is invisible without
# this step.
- name: Build and smoke-test the npm bundle on Node
run: |
bun run build
node dist/mna.js --version
# Seed a throwaway HOME with a JSONC config so the install actually
# reaches jsonc-parser's parse/modify/applyEdits. On a pristine HOME
# nothing is detected, no config is read, and a lazy require inside
# those functions would still ship — which is the exact class of bug
# this step exists to catch.
SMOKE_HOME="$(mktemp -d)"
export HOME="$SMOKE_HOME" XDG_CONFIG_HOME="$SMOKE_HOME/.config"
mkdir -p "$SMOKE_HOME/.cursor"
printf '%s\n' \
'{' \
' // a comment jsonc-parser must preserve' \
' "mcpServers": {' \
' "existing": { "url": "https://example.invalid/mcp" },' \
' }' \
'}' > "$SMOKE_HOME/.cursor/mcp.json"
node dist/mna.js skills list --all --json > /dev/null
node dist/mna.js skills install --client cursor --yes
echo "--- resulting config ---"
cat "$SMOKE_HOME/.cursor/mcp.json"
grep -q 'a comment jsonc-parser must preserve' "$SMOKE_HOME/.cursor/mcp.json"
grep -q 'my-next-adventure' "$SMOKE_HOME/.cursor/mcp.json"
grep -q 'existing' "$SMOKE_HOME/.cursor/mcp.json"
test -f "$SMOKE_HOME/.cursor/skills/mna/SKILL.md"
echo "bundle smoke test OK"