E2E Tests and Golden Paths Analysis #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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| unit-and-integration-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build and start containers | |
| run: | | |
| cd mock-project | |
| docker compose up --build -d | |
| - name: Wait for API | |
| run: sleep 10 | |
| - name: Run unit tests | |
| run: | | |
| cd mock-project | |
| docker compose exec api pytest unit_tests/ -v | |
| - name: Run integration tests | |
| run: | | |
| cd mock-project | |
| docker compose exec api pytest integration_tests/ -v | |
| - name: Stop containers | |
| run: | | |
| cd mock-project | |
| docker compose down | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: | | |
| cd mock-project | |
| npm ci | |
| - name: Install Playwright browsers | |
| run: | | |
| cd mock-project | |
| npx playwright install chromium | |
| - name: Start containers | |
| run: | | |
| cd mock-project | |
| docker compose up --build -d | |
| - name: Wait for API to be ready | |
| run: | | |
| sleep 10 | |
| curl --retry 5 --retry-delay 2 --retry-connrefused http://localhost:5000/health || true | |
| - name: Run Playwright tests | |
| run: | | |
| cd mock-project | |
| npx playwright test | |
| - name: Stop containers | |
| run: | | |
| cd mock-project | |
| docker compose down |