chore: move .gitea/workflows/mcp-build-test.yml to .mokogitea/mcp-build-test.yml [skip ci]

This commit is contained in:
2026-05-12 05:15:00 +00:00
parent 221592bba8
commit 6e541ca2a2
+65
View File
@@ -0,0 +1,65 @@
# MCP Server Build & Validation
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Builds the MCP server, validates TypeScript compilation, and checks
# that tools are properly registered with valid Zod schemas.
name: MCP Build & Validate
on:
push:
branches: [main, dev/**]
paths: ['src/**', 'package.json', 'tsconfig.json']
pull_request:
branches: [main]
paths: ['src/**', 'package.json', 'tsconfig.json']
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22]
steps:
- 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: TypeScript compile
run: npx tsc --noEmit
- name: Build
run: npm run build
- name: Verify dist output exists
run: |
test -f dist/index.js || (echo "ERROR: dist/index.js not found" && exit 1)
test -f dist/client.js || (echo "ERROR: dist/client.js not found" && exit 1)
test -f dist/config.js || (echo "ERROR: dist/config.js not found" && exit 1)
test -f dist/types.js || (echo "ERROR: dist/types.js not found" && exit 1)
echo "✓ All required dist files present"
- name: Verify shebang in index.js
run: |
head -1 dist/index.js | grep -q "#!/usr/bin/env node" || echo "WARNING: Missing shebang in dist/index.js"
- name: Count registered tools
run: |
TOOL_COUNT=$(grep -c "server\.tool(" src/index.ts || true)
echo "Registered tools: ${TOOL_COUNT}"
if [ "${TOOL_COUNT}" -eq 0 ]; then
echo "ERROR: No tools registered in src/index.ts"
exit 1
fi