更新.gitlab-ci.yml文件
This commit is contained in:
parent
fadfbe60fc
commit
afe574d2ca
@ -1,37 +1,11 @@
|
|||||||
stages:
|
|
||||||
- test
|
|
||||||
- report
|
|
||||||
|
|
||||||
playwright_tests:
|
playwright_tests:
|
||||||
stage: test
|
stage: test
|
||||||
image: mcr.microsoft.com/playwright:v1.43.0-jammy # 使用官方 Playwright 镜像
|
image: mcr.microsoft.com/playwright:v1.43.0-jammy
|
||||||
before_script:
|
|
||||||
- npm config set registry https://registry.npmmirror.com # 使用淘宝镜像
|
|
||||||
script:
|
script:
|
||||||
- npm install
|
- npm install
|
||||||
- npx playwright install
|
- npx playwright install
|
||||||
- npx playwright test
|
- npx playwright test
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- test-results/
|
|
||||||
expire_in: 1 week
|
|
||||||
tags:
|
tags:
|
||||||
- test
|
- docker # 这里要和注册 Runner 时的 `tag-list` 一致
|
||||||
only:
|
|
||||||
- main
|
|
||||||
|
|
||||||
send_report:
|
|
||||||
stage: report
|
|
||||||
image: alpine:latest
|
|
||||||
script:
|
|
||||||
- apk add --no-cache curl
|
|
||||||
- |
|
|
||||||
if [ -d test-results ]; then
|
|
||||||
echo "Test Successful."
|
|
||||||
else
|
|
||||||
echo "No test results found."
|
|
||||||
fi
|
|
||||||
tags:
|
|
||||||
- test
|
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
|
|||||||
Reference in New Issue
Block a user