feat(ci): use install.bat for all Windows CI jobs #69
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install -e ".[dev]" | |
| - run: ruff check src/ tests/ | |
| test: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip install -e ".[dev,monitoring]" | |
| - run: pytest tests/ -v --ignore=tests/test_mcp_integration.py --cov=matlab_mcp --cov-report=xml --cov-report=term-missing | |
| - uses: codecov/codecov-action@v4 | |
| if: matrix.python-version == '3.12' | |
| with: | |
| files: coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| security: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install -e ".[dev,monitoring]" | |
| - run: pip-audit | |
| continue-on-error: true | |
| build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install build twine | |
| - run: python -m build | |
| - run: twine check dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| test-windows: | |
| needs: lint | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-2022, windows-latest] | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Run install.bat (real user install path) | |
| shell: cmd | |
| run: call install.bat < nul | |
| - name: Verify server loads via install.bat venv | |
| shell: cmd | |
| run: | | |
| call .venv\Scripts\activate.bat | |
| python -c "from matlab_mcp.server import main; print('OK: server module loads')" | |
| python -c "from matlab_mcp.auth.middleware import BearerAuthMiddleware; print('OK: auth module loads')" | |
| python -c "from matlab_mcp.hitl.gate import request_execute_approval; print('OK: hitl module loads')" | |
| python -c "from matlab_mcp.config import HITLConfig; print('OK: HITLConfig loads')" | |
| - name: Install test deps and run tests | |
| shell: cmd | |
| run: | | |
| call .venv\Scripts\activate.bat | |
| pip install pytest pytest-asyncio pytest-timeout --quiet | |
| pytest tests/ -v -k "not matlab" --ignore=tests/test_integration.py --ignore=tests/test_mcp_integration.py -W ignore::pytest.PytestUnraisableExceptionWarning | |
| test-macos: | |
| needs: lint | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip install -e ".[dev,monitoring]" | |
| - run: pytest tests/ -v -k "not matlab" --ignore=tests/test_mcp_integration.py -W ignore::pytest.PytestUnraisableExceptionWarning | |
| integration-test: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install -e ".[dev,monitoring]" pytest-timeout | |
| - run: pytest tests/test_mcp_integration.py -v -m integration --timeout=60 | |
| integration-test-windows: | |
| needs: lint | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Run install.bat (real user install path) | |
| shell: cmd | |
| run: call install.bat < nul | |
| - name: Run integration test via install.bat venv | |
| shell: cmd | |
| run: | | |
| call .venv\Scripts\activate.bat | |
| pip install pytest pytest-asyncio pytest-timeout httpx mcp --quiet | |
| pytest tests/test_mcp_integration.py -v -m integration --timeout=60 | |
| remote-integration-test: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: docker compose -f docker-compose.test.yml up --build --exit-code-from client | |
| - name: Cleanup | |
| if: always() | |
| run: docker compose -f docker-compose.test.yml down -v | |
| docker: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: docker build -t matlab-mcp:test . | |
| - name: Smoke-test container health endpoint | |
| run: | | |
| docker run -d --name mcp-test \ | |
| -e MATLAB_MCP_SERVER_TRANSPORT=sse \ | |
| -e MATLAB_MCP_MONITORING_ENABLED=true \ | |
| -p 8765:8765 \ | |
| matlab-mcp:test | |
| # The server will crash on pool start (no MATLAB engine in CI). | |
| # curl will fail; || true prevents the step from failing. | |
| # Goal: verify the image builds and the ENTRYPOINT is valid. | |
| sleep 5 | |
| curl --retry 5 --retry-delay 2 --retry-connrefused \ | |
| http://localhost:8765/health || true | |
| docker logs mcp-test | |
| docker stop mcp-test || true | |
| docker rm mcp-test || true |