Tests/e2e auth #35
Workflow file for this run
This file contains 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: Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
VITE_API_URL: http://localhost:3000 | |
API_SECRET: ${{ secrets.API_SECRET }} | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
POSTGRES_DB: quotes | |
DATABASE_URL: postgres://postgres:${{ secrets.POSTGRES_PASSWORD }}@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 | |
# container: mcr.microsoft.com/playwright:v1.37.0-jammy | |
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 |