Skip to content

👷 ci: Create CI workflow for Playwright E2E tests #18

👷 ci: Create CI workflow for Playwright E2E tests

👷 ci: Create CI workflow for Playwright E2E tests #18

Workflow file for this run

name: Playwright E2E Tests
on:
pull_request:
branches: ["*"]
push:
branches: ["main"]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
# You can leverage Vercel Remote Caching with Turbo to speed up your builds
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
env:
FORCE_COLOR: 3
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
jobs:
e2e-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Setup
uses: ./tooling/github-actions/setup
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run local databases with Docker Compose
uses: hoverkraft-tech/compose-action@v2.0.1
- name: Setup environment variables for Student
run: cp .env.example .env
working-directory: apps/student/
- name: Setup environment variables for Library
run: cp .env.example .env
working-directory: apps/library/
- name: Setup environment variables for Finance
run: cp .env.example .env
working-directory: apps/finance/
- name: Setup database with migrations and seed data
run: pnpm db:setup
- name: Build monorepo
run: pnpm build
- name: Run Playwright tests
run: cd apps/student/ && pnpm exec playwright test
- uses: daun/playwright-report-summary@v3
if: always()
with:
report-file: results.json
comment-title: "Playwright Test Results"
custom-info: "Generated by GitHub Actions [(Link to Action)](https://github.com/marketplace/actions/playwright-report-comment)"
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30