|
| 1 | +# CI/CD Workflows for MCP External Validation |
| 2 | + |
| 3 | +This directory contains GitHub Actions workflows for continuous integration and deployment of the MCP External Validation framework. |
| 4 | + |
| 5 | +## Workflows |
| 6 | + |
| 7 | +### 1. External Validation (`external-validation.yml`) |
| 8 | +**Trigger:** Push to main/develop, PRs, daily schedule, manual dispatch |
| 9 | + |
| 10 | +**Purpose:** Comprehensive validation testing across platforms and Rust versions |
| 11 | + |
| 12 | +**Features:** |
| 13 | +- Multi-OS testing (Ubuntu, macOS, Windows) |
| 14 | +- Multiple Rust versions (stable, nightly) |
| 15 | +- Python SDK compatibility testing |
| 16 | +- MCP Inspector integration |
| 17 | +- Property-based testing with proptest |
| 18 | +- Full compliance validation |
| 19 | +- Performance benchmarking |
| 20 | +- Security scanning |
| 21 | + |
| 22 | +**Artifacts:** |
| 23 | +- Compliance reports (JSON format) |
| 24 | +- Test results |
| 25 | + |
| 26 | +### 2. Docker Validation (`docker-validation.yml`) |
| 27 | +**Trigger:** Push to main/develop, PRs, manual dispatch |
| 28 | + |
| 29 | +**Purpose:** Containerized validation testing |
| 30 | + |
| 31 | +**Features:** |
| 32 | +- Docker image build and push to GitHub Container Registry |
| 33 | +- Multi-version protocol testing |
| 34 | +- Container-based validation runs |
| 35 | +- Matrix testing for protocol versions and transports |
| 36 | + |
| 37 | +### 3. Scheduled Validation (`scheduled-validation.yml`) |
| 38 | +**Trigger:** Every 6 hours, manual dispatch |
| 39 | + |
| 40 | +**Purpose:** Regular validation of external MCP servers |
| 41 | + |
| 42 | +**Features:** |
| 43 | +- Tests against known MCP server implementations |
| 44 | +- Generates compatibility matrix |
| 45 | +- Creates issues for validation failures |
| 46 | +- Updates COMPATIBILITY.md automatically |
| 47 | + |
| 48 | +### 4. Release Validation (`release-validation.yml`) |
| 49 | +**Trigger:** Release creation, manual dispatch |
| 50 | + |
| 51 | +**Purpose:** Comprehensive validation for releases |
| 52 | + |
| 53 | +**Features:** |
| 54 | +- Full test suite execution |
| 55 | +- Code coverage with Codecov |
| 56 | +- Cross-platform builds (Linux, macOS, Windows) |
| 57 | +- Release artifact generation |
| 58 | +- Automatic release notes update |
| 59 | + |
| 60 | +### 5. PR Validation (`pr-validation.yml`) |
| 61 | +**Trigger:** Pull request events |
| 62 | + |
| 63 | +**Purpose:** Quick validation for pull requests |
| 64 | + |
| 65 | +**Features:** |
| 66 | +- Code formatting checks |
| 67 | +- Clippy linting |
| 68 | +- Unit tests |
| 69 | +- Documentation checks |
| 70 | +- Conditional testing based on changed files |
| 71 | +- Automatic PR comments with results |
| 72 | + |
| 73 | +## Configuration |
| 74 | + |
| 75 | +### Environment Variables |
| 76 | +- `CARGO_TERM_COLOR`: Always colored output |
| 77 | +- `RUST_BACKTRACE`: Full backtraces for debugging |
| 78 | +- `MCP_VALIDATOR_API_URL`: External MCP validator API endpoint |
| 79 | +- `JSONRPC_VALIDATOR_URL`: JSON-RPC validator endpoint |
| 80 | + |
| 81 | +### Secrets Required |
| 82 | +- `GITHUB_TOKEN`: Automatically provided by GitHub Actions |
| 83 | +- No additional secrets required for public repositories |
| 84 | + |
| 85 | +### Cache Configuration |
| 86 | +All workflows use GitHub Actions cache for: |
| 87 | +- Cargo registry |
| 88 | +- Git dependencies |
| 89 | +- Build artifacts |
| 90 | + |
| 91 | +## Usage |
| 92 | + |
| 93 | +### Manual Workflow Dispatch |
| 94 | +Most workflows support manual triggering with parameters: |
| 95 | + |
| 96 | +```bash |
| 97 | +# Trigger external validation with custom server |
| 98 | +gh workflow run external-validation.yml -f server_url=https://my-mcp-server.com -f protocol_version=2024-11-05 |
| 99 | + |
| 100 | +# Trigger scheduled validation with custom servers |
| 101 | +gh workflow run scheduled-validation.yml -f test_servers="https://server1.com,https://server2.com" |
| 102 | +``` |
| 103 | + |
| 104 | +### Adding New Validation Tests |
| 105 | +1. Add test to appropriate workflow file |
| 106 | +2. Update matrix if testing multiple configurations |
| 107 | +3. Add artifact collection if needed |
| 108 | +4. Update this README |
| 109 | + |
| 110 | +### Monitoring |
| 111 | +- Check Actions tab for workflow runs |
| 112 | +- Review artifacts for detailed results |
| 113 | +- Monitor issues for automated failure reports |
| 114 | +- Check COMPATIBILITY.md for server compatibility status |
| 115 | + |
| 116 | +## Best Practices |
| 117 | + |
| 118 | +1. **Keep workflows DRY**: Use composite actions for repeated steps |
| 119 | +2. **Use caching**: Cache dependencies and build artifacts |
| 120 | +3. **Fail fast**: Use `fail-fast: false` only when needed |
| 121 | +4. **Clean up**: Always clean up resources (servers, containers) |
| 122 | +5. **Security**: Run security scans on every PR |
| 123 | +6. **Documentation**: Update this README when adding workflows |
| 124 | + |
| 125 | +## Troubleshooting |
| 126 | + |
| 127 | +### Common Issues |
| 128 | + |
| 129 | +1. **Python SDK tests failing** |
| 130 | + - Ensure Python 3.9+ is available |
| 131 | + - Check if MCP SDK is properly installed |
| 132 | + |
| 133 | +2. **Inspector not found** |
| 134 | + - Verify download URL is correct |
| 135 | + - Check platform-specific installation |
| 136 | + |
| 137 | +3. **Timeout errors** |
| 138 | + - Increase timeout values in workflow |
| 139 | + - Check server startup time |
| 140 | + |
| 141 | +4. **Cache misses** |
| 142 | + - Verify cache key includes Cargo.lock |
| 143 | + - Clear cache if corrupted |
| 144 | + |
| 145 | +### Debug Mode |
| 146 | +Enable debug logging by setting repository secret: |
| 147 | +- `ACTIONS_RUNNER_DEBUG=true` |
| 148 | +- `ACTIONS_STEP_DEBUG=true` |
0 commit comments