name: Playwright Tests
on: [pull_request]

jobs:
  playwright:
    defaults:
      run:
        working-directory: frontend
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: "16.x"
      - name: Install dependencies
        run: CI=1 yarn install
      - name: Install Playwright
        run: npx playwright install --with-deps
      - name: Run Playwright tests
        run: yarn playwright
        env:
          # This might depend on your test-runner/language binding
          PLAYWRIGHT_TEST_BASE_URL: ${{ secrets.PLAYWRIGHT_TEST_BASE_URL }}
