ci(gitlab): 更新 Playwright 镜像版本并优化 CI 配置

This commit is contained in:
LingandRX 2025-03-13 19:55:22 +08:00
parent e2df441b75
commit fadfbe60fc

View File

@ -4,23 +4,19 @@ stages:
playwright_tests: playwright_tests:
stage: test stage: test
image: mcr.microsoft.com/playwright:focal image: mcr.microsoft.com/playwright:v1.43.0-jammy # 使用官方 Playwright 镜像
before_script: before_script:
- export NVM_DIR="$HOME/.nvm"
- . "$NVM_DIR/nvm.sh"
- nvm use 20.17.0
- npm config set registry https://registry.npmmirror.com # 使用淘宝镜像 - npm config set registry https://registry.npmmirror.com # 使用淘宝镜像
script: script:
- npm install - npm install
- npx playwright install - npx playwright install
- npx playwright install-deps
- npx playwright test - npx playwright test
artifacts: artifacts:
paths: paths:
- test-results/ - test-results/
expire_in: 1 week expire_in: 1 week
tags: tags:
- test # 指定使用标签为 test 的 Runner - test
only: only:
- main - main
@ -36,6 +32,6 @@ send_report:
echo "No test results found." echo "No test results found."
fi fi
tags: tags:
- test # 指定使用标签为 test 的 Runner - test
only: only:
- main - main