name: Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
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: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Check build artifacts
run: |
test -f build/index.js
test -x build/index.js
echo "Build artifacts verified"
- name: Test MCP server
run: |
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | timeout 10s node build/index.js > test_output.json
cat test_output.json
# Verify the response contains expected tools
grep -q "get_user_by_username" test_output.json
grep -q "search_tweets" test_output.json
grep -q "create_tweet" test_output.json
echo "MCP server test passed"