Skip to content

Tests/e2e auth

Tests/e2e auth #32

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- main
env:
VITE_API_URL: http://localhost:3000
API_SECRET: 84f79269b107d58a9b40bda7ec7af0bf20fab80e323887e4b8219fefc65042d9
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: quotes
DATABASE_URL: postgres://postgres:postgres@localhost:5432/quotes
CI: 1
jobs:
unit-and-integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build
- name: Run unit tests
run: pnpm test:backend:unit
- uses: ./.github/actions/docker-compose
- name: Run integration tests
run: pnpm test:backend:int
e2e-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1/4, 2/4, 3/4, 4/4]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build
- uses: ./.github/actions/docker-compose
- uses: ./.github/actions/playwright
- name: Run e2e tests
run: pnpm test:e2e --shard=${{ matrix.shard }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: all-blob-reports
path: e2e/blob-report
retention-days: 3
merge-e2e-reports:
runs-on: ubuntu-latest
if: always()
needs: [e2e-tests]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build
- uses: actions/download-artifact@v3
with:
name: all-blob-reports
path: e2e/all-blob-reports
- name: Merge Reports
run: npx playwright merge-reports --reporter=html,github ./all-blob-reports
working-directory: e2e
- name: Upload Merged Reports
uses: actions/upload-artifact@v3
with:
name: merged-report-attempt-${{ github.run_attempt }}
path: e2e/playwright-report
retention-days: 3