E2E Tests and Golden Paths Analysis #12
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 5 | |
| - 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 --with-deps | |
| - name: Run E2E tests | |
| run: | | |
| cd mock-project | |
| ./run-e2e-tests.sh |