fix: add nohup to e2e tests, also add cross-env for windows testing #21
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: Run tests and upload coverage | |
| on: | |
| push | |
| jobs: | |
| test: | |
| name: Run tests and collect coverage | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| - name: Install backend dependencies | |
| run: pip install -r backend/requirements.txt | |
| - name: Run backend tests | |
| run: pytest --cov=backend --cov-branch --cov-report=xml backend/ | |
| - name: Set up Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Install frontend dependencies | |
| run: | | |
| cd frontend | |
| npm install | |
| - name: Build and start Next.js with coverage | |
| run: | | |
| cd frontend | |
| nohup npm run coverage & sleep 15 | |
| - name: Start backend for E2E tests | |
| run: | | |
| cd backend | |
| nohup python run_server.py & sleep 5 | |
| - name: Run Playwright tests (e2e) | |
| run: | | |
| cd frontend | |
| npx playwright install --with-deps | |
| npx playwright test --config=playwright.config.ts | |
| - name: Upload results to Codecov | |
| if: env.ACT != 'true' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |