Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
test:
name: Lint, type-check, and test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.14.1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm exec eslint .

- name: Type-check
run: pnpm compile

- name: Unit tests
run: pnpm test:unit

- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium

- name: E2E tests
run: pnpm test:e2e
18 changes: 0 additions & 18 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
import { existsSync } from 'node:fs'
import process from 'node:process'
import { defineConfig } from '@playwright/test'

const chromiumExecutablePath = [
process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE,
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
'C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe',
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
'/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge',
'/usr/bin/google-chrome',
'/usr/bin/chromium',
'/usr/bin/chromium-browser',
].find((value): value is string => Boolean(value && existsSync(value)))

export default defineConfig({
testDir: './tests/e2e',
timeout: 60_000,
Expand All @@ -25,9 +10,6 @@ export default defineConfig({
reporter: 'list',
use: {
browserName: 'chromium',
launchOptions: chromiumExecutablePath
? { executablePath: chromiumExecutablePath }
: undefined,
trace: 'retain-on-failure',
},
})
Loading