Skip to content

rename playwright action #13

rename playwright action

rename playwright action #13

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
pull-requests: write
strategy:
matrix:
task: [lint, test, e2e]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
if: matrix.task == 'e2e'
run: pnpm playwright install --with-deps
- name: Run lint
if: matrix.task == 'lint'
run: pnpm lint:ci
- name: Run tests
if: matrix.task == 'test'
run: pnpm test:ci
- name: Run e2e tests
if: matrix.task == 'e2e'
env:
AIRTABLE_PAT: ${{ secrets.AIRTABLE_PAT }}
run: pnpm test:e2e:headless
- name: Upload coverage artifact
if: matrix.task == 'test' && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: vitest-coverage
path: vitest-coverage
- name: Upload Playwright report
if: matrix.task == 'e2e' && failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Comment PR with Playwright artifact link
if: matrix.task == 'e2e' && failure() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const runId = context.runId;
const repo = context.repo;
const artifactUrl = `https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}`;
const comment = `## ❌ Playwright Tests Failed
The Playwright tests have failed. Please download the test report artifact to see detailed information about the failures:
📊 [View test run and download artifact](${artifactUrl})
**How to view the report:**
1. Click the link above
2. Scroll to the bottom to the "Artifacts" section
3. Download the \`playwright-report\` artifact
4. Extract the zip file and open \`index.html\` in your browser
The report includes screenshots, videos, and detailed traces of the failed tests.`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: repo.owner,
repo: repo.repo,
body: comment
});