|
| 1 | +# Continuous Integration (CI) |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The MCP Server has automated CI testing via GitHub Actions that runs on every push and pull request affecting the `.claude/skills/` directory. |
| 6 | + |
| 7 | +**Workflow File**: `.github/workflows/mcp-server-ci.yml` |
| 8 | + |
| 9 | +## Test Matrix |
| 10 | + |
| 11 | +Tests run across multiple environments to ensure broad compatibility: |
| 12 | + |
| 13 | +### Operating Systems |
| 14 | +- ✅ Ubuntu (Linux) |
| 15 | +- ✅ macOS |
| 16 | +- ✅ Windows |
| 17 | + |
| 18 | +### Node.js Versions |
| 19 | +- ✅ Node.js 18 (minimum supported) |
| 20 | +- ✅ Node.js 20 (LTS) |
| 21 | +- ✅ Node.js 22 (current) |
| 22 | + |
| 23 | +**Total**: 9 test combinations (3 OS × 3 Node versions) |
| 24 | + |
| 25 | +## What Gets Tested |
| 26 | + |
| 27 | +### 1. Test Job (Matrix) |
| 28 | +Each combination runs: |
| 29 | +1. **qsv Installation**: Downloads and installs latest qsv binary for the platform |
| 30 | +2. **Dependency Installation**: `npm ci` for clean install |
| 31 | +3. **TypeScript Compilation**: `npm run build` to verify code compiles |
| 32 | +4. **Integration Tests**: `npm test` runs all 28 tests including: |
| 33 | + - Unit tests for config, filesystem, pipeline, tools |
| 34 | + - Integration tests for qsv commands (count, headers, select, search, etc.) |
| 35 | + - Metadata caching and deduplication tests |
| 36 | +5. **Build Verification**: Tests that `dist/mcp-server.js` is executable |
| 37 | + |
| 38 | +### 2. Lint Job |
| 39 | +Separate TypeScript type checking: |
| 40 | +1. **Main Code Compilation**: `npm run build` |
| 41 | +2. **Test Code Compilation**: `npm run build:test` |
| 42 | + |
| 43 | +## Triggering CI |
| 44 | + |
| 45 | +CI runs automatically on: |
| 46 | +- **Push to master**: Any changes to `.claude/skills/**` or the workflow file |
| 47 | +- **Pull Requests**: Any PR targeting master with changes to MCP server code |
| 48 | +- **Manual Trigger**: Via GitHub Actions UI (`workflow_dispatch`) |
| 49 | + |
| 50 | +## Viewing Results |
| 51 | + |
| 52 | +1. Go to the [Actions tab](https://github.com/dathere/qsv/actions) in the repository |
| 53 | +2. Select "MCP Server CI" workflow |
| 54 | +3. View individual test runs for each OS/Node combination |
| 55 | + |
| 56 | +## CI Status Badge |
| 57 | + |
| 58 | +Add this badge to README.md to show CI status: |
| 59 | + |
| 60 | +```markdown |
| 61 | +[](https://github.com/dathere/qsv/actions/workflows/mcp-server-ci.yml) |
| 62 | +``` |
| 63 | + |
| 64 | +## Local Testing |
| 65 | + |
| 66 | +To run tests locally matching CI environment: |
| 67 | + |
| 68 | +```bash |
| 69 | +# Install dependencies |
| 70 | +npm ci |
| 71 | + |
| 72 | +# Run full test suite (what CI runs) |
| 73 | +npm test |
| 74 | + |
| 75 | +# Run build check |
| 76 | +npm run build |
| 77 | + |
| 78 | +# Check test compilation |
| 79 | +npm run build:test |
| 80 | +``` |
| 81 | + |
| 82 | +## Troubleshooting CI Failures |
| 83 | + |
| 84 | +### qsv Installation Fails |
| 85 | +- Check that qsv releases are available on GitHub |
| 86 | +- Verify download URLs match current release naming convention |
| 87 | + |
| 88 | +### Tests Fail on Specific Platform |
| 89 | +- Check platform-specific path handling (Windows vs Unix) |
| 90 | +- Verify qsv binary is in PATH correctly |
| 91 | + |
| 92 | +### TypeScript Compilation Fails |
| 93 | +- Run `npm run build` locally to see detailed errors |
| 94 | +- Check for missing type definitions or incompatible Node.js types |
| 95 | + |
| 96 | +### Node.js Version Issues |
| 97 | +- Ensure code uses features compatible with Node.js 18+ |
| 98 | +- Check `package.json` engines field matches minimum supported version |
| 99 | + |
| 100 | +## Performance |
| 101 | + |
| 102 | +Typical CI run times: |
| 103 | +- **Test Job (per combination)**: 2-3 minutes |
| 104 | +- **Lint Job**: 30-60 seconds |
| 105 | +- **Total (all jobs)**: ~3-5 minutes (parallel execution) |
| 106 | + |
| 107 | +## Dependencies |
| 108 | + |
| 109 | +CI automatically uses: |
| 110 | +- Latest qsv release from GitHub |
| 111 | +- Node.js versions from `actions/setup-node` |
| 112 | +- npm dependencies locked in `package-lock.json` |
0 commit comments