-
Notifications
You must be signed in to change notification settings - Fork 146
282 lines (247 loc) · 10.1 KB
/
Copy pathci.yml
File metadata and controls
282 lines (247 loc) · 10.1 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm lint
- run: pnpm format:check
- run: pnpm test:coverage
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run shellcheck
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: ./assets/skills/comet/scripts
bats-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install bats
run: sudo apt-get install -y bats
- name: Run shell tests
run: bats test/shell/*.bats
script-smoke:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Run Comet script smoke tests
run: pnpm test -- test/ts/comet-scripts.test.ts
- name: Run portable shell tests
run: pnpm test:shell
init-e2e:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Install OpenSpec CLI
run: npm install -g @fission-ai/openspec@latest
- name: Create temp project directory
run: mkdir -p "$RUNNER_TEMP/comet-e2e-project"
shell: bash
- name: Run comet init (project scope)
run: |
node bin/comet.js init "$RUNNER_TEMP/comet-e2e-project" --yes --json \
| tee "$RUNNER_TEMP/comet-init-project.json"
shell: bash
- name: Verify Comet skills installed (project)
run: |
PROJ="$RUNNER_TEMP/comet-e2e-project"
check_file() {
if [ ! -f "$1" ]; then
echo "Missing file: $1" >&2
exit 1
fi
}
for sd in .claude/skills .cursor/skills .codex/skills .opencode/skills \
.windsurf/skills .cline/skills .roo/skills .continue/skills \
.gemini/skills .amazonq/skills .qwen/skills .kilocode/skills \
.augment/skills .kiro/skills .kimi-code/skills .lingma/skills .junie/skills \
.codebuddy/skills .cospec/skills .crush/skills .factory/skills \
.iflow/skills .pi/skills .qoder/skills .agents/skills \
.bob/skills .forge/skills .trae/skills .github/skills; do
check_file "$PROJ/$sd/comet/SKILL.md"
check_file "$PROJ/$sd/comet/scripts/comet-guard.sh"
check_file "$PROJ/$sd/comet/scripts/comet-state.sh"
check_file "$PROJ/$sd/comet/scripts/comet-handoff.sh"
check_file "$PROJ/$sd/comet/scripts/comet-yaml-validate.sh"
check_file "$PROJ/$sd/comet/scripts/comet-archive.sh"
done
check_file "$PROJ/.pi/extensions/comet-commands.ts"
PROJ="$PROJ" node -e "const s=require(process.env.PROJ+'/.pi/settings.json'); if(s.enableSkillCommands!==true) process.exit(1)"
echo "All 29 platforms project Comet skills: OK"
shell: bash
- name: Verify external installer status (project)
run: |
node - "$RUNNER_TEMP/comet-init-project.json" <<'NODE'
const fs = require('fs');
function extractJsonPayload(raw) {
const start = raw.indexOf('{');
if (start < 0) {
throw new Error('No JSON payload found in init output');
}
return raw.slice(start);
}
const raw = fs.readFileSync(process.argv[2], 'utf8');
const data = JSON.parse(extractJsonPayload(raw));
const allowed = new Set(['installed', 'skipped', 'failed']);
const components = ['openspec', 'superpowers'];
const malformed = data.results.flatMap((r) =>
components
.filter((component) => !allowed.has(r[component]))
.map((component) => `${r.platform}: ${component}=${r[component]}`),
);
if (malformed.length > 0) {
console.error('External installers returned unexpected status values:');
for (const item of malformed) {
console.error(`- ${item}`);
}
process.exit(1);
}
const failed = data.results.flatMap((r) =>
components
.filter((component) => r[component] === 'failed')
.map((component) => `${r.platform}: ${component}=${r[component]}`),
);
if (failed.length > 0) {
console.warn('External installers reported failed for:');
for (const item of failed) {
console.warn(`- ${item}`);
}
}
console.log(`External installer statuses validated for ${data.results.length} platforms`);
NODE
shell: bash
- name: Verify OpenSpec and working directories (project)
run: |
test -d "$RUNNER_TEMP/comet-e2e-project/openspec"
test -d "$RUNNER_TEMP/comet-e2e-project/docs/superpowers/specs"
test -d "$RUNNER_TEMP/comet-e2e-project/docs/superpowers/plans"
echo "OpenSpec + working dirs: OK"
shell: bash
- name: Create temp global home
run: mkdir -p "$RUNNER_TEMP/comet-e2e-global"
shell: bash
- name: Run comet init (global scope)
run: |
export HOME="$RUNNER_TEMP/comet-e2e-global"
export USERPROFILE="$RUNNER_TEMP/comet-e2e-global"
node bin/comet.js init "$RUNNER_TEMP/comet-e2e-global" --yes --scope global --json \
| tee "$RUNNER_TEMP/comet-init-global.json"
shell: bash
- name: Verify Comet skills installed (global)
run: |
HOME_DIR="$RUNNER_TEMP/comet-e2e-global"
check_file() {
if [ ! -f "$1" ]; then
echo "Missing file: $1" >&2
exit 1
fi
}
for sd in .claude/skills .cursor/skills .codex/skills .config/opencode/skills \
.windsurf/skills .cline/skills .roo/skills .continue/skills \
.gemini/skills .amazonq/skills .qwen/skills .kilocode/skills \
.augment/skills .kiro/skills .kimi-code/skills .lingma/skills .junie/skills \
.codebuddy/skills .cospec/skills .crush/skills .factory/skills \
.iflow/skills .pi/agent/skills .qoder/skills .gemini/antigravity/skills \
.bob/skills .forge/skills .trae/skills .github/skills; do
check_file "$HOME_DIR/$sd/comet/SKILL.md"
check_file "$HOME_DIR/$sd/comet/scripts/comet-guard.sh"
check_file "$HOME_DIR/$sd/comet/scripts/comet-state.sh"
check_file "$HOME_DIR/$sd/comet/scripts/comet-handoff.sh"
check_file "$HOME_DIR/$sd/comet/scripts/comet-yaml-validate.sh"
check_file "$HOME_DIR/$sd/comet/scripts/comet-archive.sh"
done
check_file "$HOME_DIR/.pi/agent/extensions/comet-commands.ts"
HOME_DIR="$HOME_DIR" node -e "const s=require(process.env.HOME_DIR+'/.pi/agent/settings.json'); if(s.enableSkillCommands!==true) process.exit(1)"
echo "All 29 platforms global Comet skills: OK"
shell: bash
- name: Verify external installer status (global)
run: |
node - "$RUNNER_TEMP/comet-init-global.json" <<'NODE'
const fs = require('fs');
function extractJsonPayload(raw) {
const start = raw.indexOf('{');
if (start < 0) {
throw new Error('No JSON payload found in init output');
}
return raw.slice(start);
}
const raw = fs.readFileSync(process.argv[2], 'utf8');
const data = JSON.parse(extractJsonPayload(raw));
const allowed = new Set(['installed', 'skipped', 'failed']);
const components = ['openspec', 'superpowers'];
const malformed = data.results.flatMap((r) =>
components
.filter((component) => !allowed.has(r[component]))
.map((component) => `${r.platform}: ${component}=${r[component]}`),
);
if (malformed.length > 0) {
console.error('External installers returned unexpected status values:');
for (const item of malformed) {
console.error(`- ${item}`);
}
process.exit(1);
}
const failed = data.results.flatMap((r) =>
components
.filter((component) => r[component] === 'failed')
.map((component) => `${r.platform}: ${component}=${r[component]}`),
);
if (failed.length > 0) {
console.warn('External installers reported failed for:');
for (const item of failed) {
console.warn(`- ${item}`);
}
}
console.log(`External installer statuses validated for ${data.results.length} platforms`);
NODE
shell: bash
- name: Verify no working directories (global)
run: |
test ! -d "$RUNNER_TEMP/comet-e2e-global/docs/superpowers/specs"
echo "Global scope has no working dirs: OK"
shell: bash