-
Notifications
You must be signed in to change notification settings - Fork 25
65 lines (55 loc) · 1.77 KB
/
e2e-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build and Test with Playwright
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
pull-requests: read
jobs:
run-playwright-tests:
name: Run Playwright Tests
runs-on: ubuntu-latest
container: node:20
strategy:
matrix:
project: [nuxt-vite, rust-vite, vite-vite, multi-example]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack and Setup PNPM
run: |
corepack enable
corepack prepare [email protected] --activate
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Install Chromium Browser
run: pnpm playwright install --with-deps chromium
- name: Build Projects
run: pnpm build
- name: Start Application (${{ matrix.project }})
run: |
if [ "${{ matrix.project }}" = "vite-vite" ]; then
nohup pnpm run dev-vv &
pnpm exec wait-on http://localhost:5175;
elif [ "${{ matrix.project }}" = "nuxt-vite" ]; then
nohup pnpm run dev-nv &
pnpm exec wait-on http://localhost:3001;
elif [ "${{ matrix.project }}" = "rust-vite" ]; then
nohup pnpm run dev-rv &
pnpm exec wait-on http://localhost:5172;
else
nohup pnpm run multi-example &
pnpm exec wait-on http://localhost:5173;
fi
- name: Run Playwright Tests (${{ matrix.project }})
run: pnpm playwright test --project=${{ matrix.project }}
- name: Upload Artifacts on Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.project }}
path: reports/e2e/output
retention-days: 3