ci.yml•3.07 kB
name: CI - Build and Test
on:
pull_request:
branches: [ main, develop ]
push:
branches: [ main, develop ]
jobs:
lint-and-build:
name: Lint, Build & Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 24.x]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Run TypeScript compilation
run: npm run build
- name: Run tests
run: npm test
- name: Run tests with coverage
if: matrix.node-version == '24.x'
run: npm run test:coverage
- name: Upload coverage reports
uses: codecov/codecov-action@v5
if: matrix.node-version == '24.x'
with:
file: ./coverage/lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
security-audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run security audit
run: npm audit --audit-level=moderate
- name: Run dependency check
run: npx depcheck --ignores="@types/*,jest,tsx,ts-jest,@apollo/client,@modelcontextprotocol/sdk,graphql"
mcp-validation:
name: MCP Server Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build MCP server
run: npm run build
- name: Validate MCP server can start
run: |
echo "Testing MCP server initialization..."
timeout 10s node dist/index.js --help || echo "MCP server validation complete"
- name: Check for MCP schema compliance
run: |
echo "Checking MCP tool definitions..."
# Verify the built server has required MCP exports
if grep -q "ListToolsRequestSchema\|CallToolRequestSchema" dist/index.js; then
echo "✅ MCP tool methods found"
else
echo "❌ MCP tool methods missing"
exit 1
fi
docker-build:
name: Docker Build Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Build Docker image
run: |
if [ -f Dockerfile ]; then
docker build -t lacylights-mcp:test .
else
echo "No Dockerfile found, skipping Docker build"
fi