feat: e2e playwright tests #33
Workflow file for this run
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: Playwright Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: Playwright tests | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| env: | |
| TEST_EMAIL: ${{ secrets.TEST_EMAIL }} | |
| DB_HOST: localhost | |
| DB_PORT: 5432 | |
| DB_USER: postgres | |
| DB_PASSWORD: postgres | |
| DB_DATABASE: postgres | |
| CORS_ORIGIN: http://localhost:3000 | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set up AdonisJS environment | |
| working-directory: backend | |
| run: | | |
| cp .env.development .env | |
| node ace generate:key | |
| - name: Set up Next.JS environment | |
| working-directory: frontend | |
| run: | | |
| cp .env.example .env | |
| - name: Run AdonisJS migrations | |
| run: node ace migration:run | |
| working-directory: backend | |
| - name: Run seeders | |
| run: node ace db:seed | |
| working-directory: backend | |
| - name: Rollback and rerun AdonisJS migrations | |
| run: node ace migration:refresh | |
| working-directory: backend | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run Playwright tests | |
| run: npx playwright test | |
| env: | |
| TEST_EMAIL: ${{ secrets.TEST_EMAIL }} | |
| DB_HOST: localhost | |
| DB_PORT: 5432 | |
| DB_USER: postgres | |
| DB_PASSWORD: postgres | |
| DB_DATABASE: postgres | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |