Skip to content

feat: add playwright testing #10

feat: add playwright testing

feat: add playwright testing #10

Workflow file for this run

name: Playwright Tests
on:
push:
pull_request:
branches:
- main
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
CI: true
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: ${{ matrix.node-version }}
- name: Set Environment Variables
run: cp sample.env .env
- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 9
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: |
pnpm install
- name: Install Playwright Browsers
run: |
npx playwright install --with-deps
- name: Build
run: |
pnpm build
- name: Run Playwright tests
run: |
pnpm exec playwright test
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 7