name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 21]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Run tests with coverage
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
- name: Build project
run: npm run build
- name: Test package installation
run: |
npm pack
npm install -g yt-transcript-dl-mcp-*.tgz
yt-transcript-dl-mcp --help
- name: Test multi-transport mode
run: |
# Start server in background
timeout 10s npm run start:multi || true
# Check if ports are listening (basic smoke test)
sleep 2
netstat -tuln | grep :3001 || echo "SSE port not found"
netstat -tuln | grep :3002 || echo "HTTP port not found"
docker-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Test Docker build locally
run: |
# Build for local testing only
docker build -t yt-transcript-dl-mcp:test .
# Test basic functionality
docker run --rm yt-transcript-dl-mcp:test --help
# Test multi-transport mode (brief test)
timeout 10s docker run --rm -p 3001:3001 -p 3002:3002 yt-transcript-dl-mcp:test --multi-transport || true
security:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run security audit
run: npm audit --audit-level high
- name: Check for known vulnerabilities
run: npm audit --audit-level moderate