-
Notifications
You must be signed in to change notification settings - Fork 30
198 lines (170 loc) · 5.52 KB
/
ci-simplified.yml
File metadata and controls
198 lines (170 loc) · 5.52 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
name: CI/CD Pipeline (Simplified)
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
NODE_ENV: test
jobs:
validate:
name: Build and Core Validation
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18, 20]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: server/package-lock.json
- name: Install dependencies
run: |
cd server
npm ci --prefer-offline --no-audit
- name: TypeScript type checking
run: |
cd server
npm run typecheck
- name: Build project
run: |
cd server
npm run build
- name: Run server integration tests
run: |
cd server
npm run test:server-integration
timeout-minutes: 5
- name: Validate MCP server startup (Unix)
if: runner.os != 'Windows'
run: |
cd server
timeout 10s npm run start:debug 2>&1 | head -20 || true
exit_code=$?
if [ $exit_code -eq 124 ]; then
echo "✅ Server startup timeout (expected)"
else
echo "❌ Server startup failed with exit code: $exit_code"
exit 1
fi
- name: Validate MCP server startup (Windows)
if: runner.os == 'Windows'
run: |
cd server
$job = Start-Job -ScriptBlock { npm run start:debug }
Start-Sleep -Seconds 10
Stop-Job $job
Remove-Job $job
Write-Host "✅ Server startup timeout (expected)"
shell: powershell
- name: Upload build artifacts
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18'
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
server/dist/
server/package.json
server/package-lock.json
retention-days: 7
enhanced-tests:
name: Enhanced Framework Tests
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: server/package-lock.json
- name: Install dependencies
run: |
cd server
npm ci --prefer-offline --no-audit
- name: Build project
run: |
cd server
npm run build
- name: Run CAGEERF framework tests
run: |
cd server
npm run test:cageerf-framework
timeout-minutes: 10
- name: Run MCP tools tests
run: |
cd server
npm run test:mcp-tools
timeout-minutes: 10
- name: Run performance and memory tests
run: |
cd server
npm run test:performance-memory
timeout-minutes: 15
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: server/package-lock.json
- name: Install dependencies
run: |
cd server
npm ci --prefer-offline --no-audit
- name: Check for sensitive files
run: |
if find . -name "*.env*" -o -name "*.key" -o -name "*.pem" -o -name "*.p12" | grep -v node_modules | grep -q .; then
echo "❌ Sensitive files found in repository"
find . -name "*.env*" -o -name "*.key" -o -name "*.pem" -o -name "*.p12" | grep -v node_modules
exit 1
else
echo "✅ No sensitive files found"
fi
- name: Validate TypeScript files
run: |
cd server
find src -name "*.ts" -exec echo "Checking {}" \;
if find src -name "*.js" | grep -q .; then
echo "❌ JavaScript files found in TypeScript source directory"
find src -name "*.js"
exit 1
else
echo "✅ All source files are TypeScript"
fi
- name: Check package.json consistency
run: |
cd server
if npm ls --depth=0 >/dev/null 2>&1; then
echo "✅ Package.json dependencies are consistent"
else
echo "❌ Package.json dependency issues found"
npm ls --depth=0 || true
exit 1
fi
- name: Validate build artifacts
run: |
cd server
npm run build
if [ -d "dist" ] && [ -f "dist/index.js" ]; then
echo "✅ Build artifacts generated successfully"
else
echo "❌ Build artifacts missing"
ls -la dist/ || echo "dist directory not found"
exit 1
fi