-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (194 loc) · 5.92 KB
/
Copy pathci.yml
File metadata and controls
203 lines (194 loc) · 5.92 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
docs-lint:
name: Markdown lint (changelog)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run lint:md:changelog
test:
runs-on: ubuntu-latest
needs: docs-lint
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run build
- name: CLI --version matches package.json
run: |
PKG=$(node -p "require('./package.json').version")
CLI=$(node dist/index.js --version)
if [ "$PKG" != "$CLI" ]; then
echo "Version drift: package.json=$PKG, CLI=$CLI"
exit 1
fi
- run: npm test
- run: npm run test:workspaces
bundle-smoke:
name: esbuild bundle smoke test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run build
- name: Shebang count must be exactly 1
run: |
COUNT=$(grep -c "#!/usr/bin/env node" dist/index.js)
if [ "$COUNT" -ne 1 ]; then
echo "FAIL: Expected 1 shebang, found $COUNT"
exit 1
fi
echo "OK: shebang count = $COUNT"
- name: Node.js syntax check
run: node --check dist/index.js
- name: --version smoke test (exits 0, outputs correct semver)
run: |
PKG=$(node -p "require('./package.json').version")
CLI=$(node dist/index.js --version)
echo "package.json=$PKG bundle=$CLI"
if [ "$PKG" != "$CLI" ]; then
echo "FAIL: version mismatch"
exit 1
fi
- name: Bundle size check
run: npm test -- tests/build/
offline-smoke:
name: Offline size budgets
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
- name: Seed device-cache fixture
run: |
mkdir -p "$HOME/.switchbot"
cat > "$HOME/.switchbot/devices.json" <<'JSON'
{
"lastUpdated": "2026-04-20T00:00:00.000Z",
"devices": {
"BOT001": { "type": "Bot", "name": "Test Bot", "category": "physical" },
"METER001": { "type": "Meter", "name": "Test Meter", "category": "physical" },
"STRIP001": { "type": "Strip Light 3", "name": "Test Strip", "category": "physical" },
"IRTV001": { "type": "TV", "name": "Test TV", "category": "ir" }
}
}
JSON
- name: agent-bootstrap --compact must stay under 20 KB
run: |
OUT=$(node dist/index.js agent-bootstrap --compact)
BYTES=$(printf '%s' "$OUT" | wc -c)
echo "agent-bootstrap --compact = $BYTES bytes"
if [ "$BYTES" -ge 20000 ]; then
echo "FAIL: budget is 20000, got $BYTES"
exit 1
fi
- name: schema export --compact --used must stay under 15 KB
run: |
OUT=$(node dist/index.js schema export --compact --used)
BYTES=$(printf '%s' "$OUT" | wc -c)
echo "schema export --compact --used = $BYTES bytes"
if [ "$BYTES" -ge 15000 ]; then
echo "FAIL: budget is 15000, got $BYTES"
exit 1
fi
pack-install-smoke:
name: Packed install smoke (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
- name: npm pack -> npm install tarball -> switchbot --version / policy new / policy validate
run: npm run smoke:pack-install
codex-release-gates:
name: Codex release gates (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run verify:release-gate
claude-code-release-gates:
name: Claude Code release gates (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
- run: npm run smoke:claude-code-pack-install
gemini-release-gates:
name: Gemini extension release gates (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
- run: npm run smoke:gemini-extension-lint
- name: Workspace tests
run: cd packages/gemini-extension && node --test