ci: 优化 Playwright 测试工作流
This commit is contained in:
5
.github/workflows/playwright.yaml
vendored
5
.github/workflows/playwright.yaml
vendored
@@ -18,6 +18,7 @@ jobs:
|
|||||||
uses: yanhao98/composite-actions/setup-node-environment@25eb4dc0c134cc9df2b7c569aa54140a366b45a8
|
uses: yanhao98/composite-actions/setup-node-environment@25eb4dc0c134cc9df2b7c569aa54140a366b45a8
|
||||||
# - name: 📥 安装 Playwright 浏览器
|
# - name: 📥 安装 Playwright 浏览器
|
||||||
# run: pnpm exec playwright install --with-deps
|
# run: pnpm exec playwright install --with-deps
|
||||||
|
- name: 📦 构建项目
|
||||||
|
run: pnpm run build-only
|
||||||
- name: ▶️ 运行 Playwright 测试
|
- name: ▶️ 运行 Playwright 测试
|
||||||
run: |
|
run: pnpm exec playwright test
|
||||||
npx playwright test
|
|
||||||
|
@@ -106,7 +106,7 @@ export default defineConfig({
|
|||||||
* Use the preview server on CI for more realistic testing.
|
* Use the preview server on CI for more realistic testing.
|
||||||
* Playwright will re-use the local server if there is already a dev-server running.
|
* Playwright will re-use the local server if there is already a dev-server running.
|
||||||
*/
|
*/
|
||||||
command: process.env.CI ? 'npm run preview' : 'npm run dev',
|
command: process.env.CI ? 'pnpm run preview' : 'pnpm run dev',
|
||||||
port: Number(new URL(baseURL).port),
|
port: Number(new URL(baseURL).port),
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user