forked from module-federation/vite
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (76 loc) · 2.49 KB
/
e2e-test.yml
File metadata and controls
95 lines (76 loc) · 2.49 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: multi-example - e2e tests
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
pull-requests: read
jobs:
# Dev mode tests - uses vite dev server
run-playwright-tests-dev:
name: Playwright Tests (Dev Mode)
runs-on: ubuntu-latest
container: node:20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Enable Corepack and Setup PNPM
run: |
corepack enable
corepack prepare pnpm@9.14.2 --activate
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Install Chromium Browser
run: pnpm playwright install --with-deps chromium
- name: Build Plugin
run: pnpm build
- name: Start Application (Dev Mode)
run: nohup pnpm run multi-example & pnpm exec wait-on http://localhost:5173;
- name: Run Playwright Tests (Dev)
run: pnpm playwright test --project=multi-example
- name: Upload Artifacts on Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-dev
path: reports/e2e/output
retention-days: 3
# Build/Preview mode tests - validates production builds work correctly
# This catches issues like Vite 7/Rolldown CJS wrapper problems
run-playwright-tests-preview:
name: Playwright Tests (Build/Preview Mode)
runs-on: ubuntu-latest
container: node:20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Enable Corepack and Setup PNPM
run: |
corepack enable
corepack prepare pnpm@9.1.3 --activate
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Install Chromium Browser
run: pnpm playwright install --with-deps chromium
- name: Build Plugin
run: pnpm build
- name: Build Example Apps
run: pnpm --filter "multi-example-*" run build
- name: Start Application (Preview Mode)
run: |
cd examples/vite-webpack-rspack/host
nohup pnpm preview --port 4173 &
cd ../../..
pnpm exec wait-on http://localhost:4173
- name: Run Playwright Tests (Preview)
run: pnpm playwright test --project=multi-example-preview
- name: Upload Artifacts on Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-preview
path: reports/e2e/output
retention-days: 3