Skip to content

ci: pull_request trigger for Playwright workflow #98

ci: pull_request trigger for Playwright workflow

ci: pull_request trigger for Playwright workflow #98

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [development, production]
pull_request:
branches: [development, production]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
CI: Playwright
PORT: 3000
jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-playwright-
- name: Install dependencies
run: pnpm install
- name: Setup playwright binaries cache
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}-
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Setup build cache
uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Build
run: pnpm run build
- name: Copy Static Files
run: cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/
- name: Run Playwright Tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 14