name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [16, 18, 20]
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 }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Run linting (if available)
run: npm run lint --if-present
- name: Run tests
run: npm test
- name: Run build
run: npm run build
- name: Test package installation
run: |
npm pack
mkdir test-install
cd test-install
npm init -y
npm install ../simple-memory-mcp-*.tgz
shell: bash
- name: Upload coverage to Codecov (Ubuntu + Node 18 only)
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18'
uses: codecov/codecov-action@v3
with:
file: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella