Merge pull request #187 from IUMusicalFish19/arsenez2006-patch-1 #113
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: Integration / Unit Tests Frontend | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| pull_request: | |
| branches: [ main, dev ] | |
| jobs: | |
| test: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| services: | |
| mongo: | |
| image: mongo | |
| ports: | |
| - 27017:27017 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r RunnerNode/requirements.txt | |
| - name: Install Node.js dependencies | |
| working-directory: UI | |
| run: npm ci | |
| - name: Start FastAPI server in background | |
| run: | | |
| PYTHONPATH=RunnerNode uvicorn connect:socket_app --host 0.0.0.0 --port 52525 & | |
| echo "Waiting for server to start..." | |
| for i in {1..15}; do | |
| if curl -s http://localhost:52525/docs > /dev/null; then | |
| echo "Server is up!"; | |
| break; | |
| fi | |
| echo "Waiting for server..." | |
| sleep 1 | |
| done | |
| - name: Run Jest tests | |
| working-directory: UI | |
| run: npm run test |