name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
name: Test on Node ${{ matrix.node-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.x, 22.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: Digital-Defiance/mcp-debugger-server
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Lint
run: yarn lint || true
- name: Build
run: yarn build
- name: Test
run: yarn test
env:
CI: true
- name: Upload coverage
if: matrix.node-version == '20.x' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
build-check:
name: Build Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: Digital-Defiance/mcp-debugger-server
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn build
- name: Check for build artifacts
run: |
if [ ! -d "dist" ]; then
echo "Error: dist directory not found"
exit 1
fi
echo "✓ Package built successfully"
- name: Verify CLI executable
run: |
if [ ! -f "dist/src/cli.js" ]; then
echo "Error: CLI not built"
exit 1
fi
echo "✓ CLI built successfully"