Skip to content

feat: GitHub Actions CI/CD pipeline and CAGEERF framework integration #3

feat: GitHub Actions CI/CD pipeline and CAGEERF framework integration

feat: GitHub Actions CI/CD pipeline and CAGEERF framework integration #3

Workflow file for this run

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