Update server.py #23
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: Vial MCP CI/CD | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r vial/requirements.txt | |
| - name: Check for test files | |
| run: | | |
| if [ -z "$(find vial/tests/ -name 'test_*.py')" ]; then | |
| echo "No test files found in vial/tests/" | |
| exit 1 | |
| fi | |
| - name: Check static assets | |
| run: | | |
| if [ ! -f static/dexie.min.js ] || [ ! -f static/redaxios.min.js ] || [ ! -f static/icon.png ]; then | |
| echo "Missing static assets in static/" | |
| exit 1 | |
| fi | |
| - name: Run tests | |
| run: | | |
| python -m pytest vial/tests/ --verbose --junitxml=test-results.xml | |
| continue-on-error: true | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v3 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: test-results.xml | |
| - name: Build Docker image | |
| run: | | |
| docker build -t vial-mcp -f vial/Dockerfile vial | |
| - name: Run Docker container | |
| run: | | |
| docker run -d -p 5000:5000 --rm --name vial-mcp-container -v /tmp:/data/vial_results vial-mcp | |
| sleep 5 | |
| docker ps | grep vial-mcp-container | |
| timeout-minutes: 1 | |
| - name: Cleanup Docker container | |
| if: always() | |
| run: | | |
| docker stop vial-mcp-container || true | |
| docker rm vial-mcp-container || true |