-
Notifications
You must be signed in to change notification settings - Fork 10
108 lines (86 loc) · 2.94 KB
/
ci.yml
File metadata and controls
108 lines (86 loc) · 2.94 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
name: CI/CD Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: Test & Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check code formatting
run: npm run format:check
- name: Sync schemas from AdCP
run: npm run sync-schemas
- name: Validate generated files are in sync
run: |
npm run generate-types
npm run generate-wellknown-schemas
if ! git diff --exit-code -I '// Generated at:' src/lib/types/*.generated.ts src/lib/agents/index.generated.ts 2>/dev/null; then
echo ""
echo "❌ Generated TypeScript files are out of sync with AdCP schemas!"
echo ""
echo "📋 Changes detected in:"
git diff --name-only src/lib/types/*.generated.ts src/lib/agents/index.generated.ts 2>/dev/null || true
echo ""
echo "🔧 To fix, run locally:"
echo " npm run sync-schemas"
echo " npm run generate-types"
echo " npm run generate-wellknown-schemas"
echo ""
echo "Then commit the updated generated files."
exit 1
fi
echo "✅ Generated files are in sync with schemas"
- name: Check protocol-managed skills present and paths resolve
run: npm run check:skill-sync
- name: Validate agent docs are in sync
run: npm run ci:docs-check
- name: Run TypeScript type checking
run: npm run typecheck
- name: Build library
run: npm run build:lib
- name: Typecheck examples
run: npm run typecheck:examples
- name: Typecheck skill code samples
run: npm run typecheck:skill-examples
- name: Run unit tests
run: npm test
env:
CI: true
- name: Validate package exports
run: |
node -e "
const pkg = require('./package.json');
const fs = require('fs');
if (!fs.existsSync(pkg.main)) {
throw new Error('Main export file does not exist: ' + pkg.main);
}
if (!fs.existsSync(pkg.types)) {
throw new Error('Types export file does not exist: ' + pkg.types);
}
console.log('✅ Package exports are valid');
"
- name: Run security audit
run: |
npm audit || true
if npm audit --audit-level=high 2>/dev/null; then
echo "✅ No high or critical vulnerabilities found"
else
echo "❌ High or critical vulnerabilities found"
npm audit --audit-level=high
exit 1
fi