Skip to content

Commit a71983b

Browse files
authored
ci: run pull request tests in GitHub Actions (#13)
1 parent 63057ed commit a71983b

2 files changed

Lines changed: 54 additions & 18 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
- ready_for_review
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
test:
20+
name: Lint, type-check, and test
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: 9.14.1
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 22
36+
cache: pnpm
37+
38+
- name: Install dependencies
39+
run: pnpm install --frozen-lockfile
40+
41+
- name: Lint
42+
run: pnpm exec eslint .
43+
44+
- name: Type-check
45+
run: pnpm compile
46+
47+
- name: Unit tests
48+
run: pnpm test:unit
49+
50+
- name: Install Playwright browsers
51+
run: pnpm exec playwright install --with-deps chromium
52+
53+
- name: E2E tests
54+
run: pnpm test:e2e

‎playwright.config.ts‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
import{existsSync}from'node:fs'
2-
importprocessfrom'node:process'
31
import{defineConfig}from'@playwright/test'
42

5-
constchromiumExecutablePath=[
6-
process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE,
7-
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
8-
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
9-
'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
10-
'C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe',
11-
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
12-
'/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge',
13-
'/usr/bin/google-chrome',
14-
'/usr/bin/chromium',
15-
'/usr/bin/chromium-browser',
16-
].find((value): value is string=>Boolean(value&&existsSync(value)))
17-
183
exportdefaultdefineConfig({
194
testDir: './tests/e2e',
205
timeout: 60_000,
@@ -25,9 +10,6 @@ export default defineConfig({
2510
reporter: 'list',
2611
use: {
2712
browserName: 'chromium',
28-
launchOptions: chromiumExecutablePath
29-
? {executablePath: chromiumExecutablePath}
30-
: undefined,
3113
trace: 'retain-on-failure',
3214
},
3315
})

0 commit comments

Comments
 (0)