ci(gitlab): 更新 Playwright 镜像版本并优化 CI 配置
This commit is contained in:
parent
e2df441b75
commit
fadfbe60fc
@ -4,23 +4,19 @@ stages:
|
||||
|
||||
playwright_tests:
|
||||
stage: test
|
||||
image: mcr.microsoft.com/playwright:focal
|
||||
image: mcr.microsoft.com/playwright:v1.43.0-jammy # 使用官方 Playwright 镜像
|
||||
before_script:
|
||||
- export NVM_DIR="$HOME/.nvm"
|
||||
- . "$NVM_DIR/nvm.sh"
|
||||
- nvm use 20.17.0
|
||||
- npm config set registry https://registry.npmmirror.com # 使用淘宝镜像
|
||||
script:
|
||||
- npm install
|
||||
- npx playwright install
|
||||
- npx playwright install-deps
|
||||
- npx playwright test
|
||||
artifacts:
|
||||
paths:
|
||||
- test-results/
|
||||
expire_in: 1 week
|
||||
tags:
|
||||
- test # 指定使用标签为 test 的 Runner
|
||||
- test
|
||||
only:
|
||||
- main
|
||||
|
||||
@ -36,6 +32,6 @@ send_report:
|
||||
echo "No test results found."
|
||||
fi
|
||||
tags:
|
||||
- test # 指定使用标签为 test 的 Runner
|
||||
- test
|
||||
only:
|
||||
- main
|
||||
|
||||
Reference in New Issue
Block a user