更新.gitlab-ci.yml文件
This commit is contained in:
parent
fadfbe60fc
commit
afe574d2ca
@ -1,37 +1,11 @@
|
||||
stages:
|
||||
- test
|
||||
- report
|
||||
|
||||
playwright_tests:
|
||||
stage: test
|
||||
image: mcr.microsoft.com/playwright:v1.43.0-jammy # 使用官方 Playwright 镜像
|
||||
before_script:
|
||||
- npm config set registry https://registry.npmmirror.com # 使用淘宝镜像
|
||||
image: mcr.microsoft.com/playwright:v1.43.0-jammy
|
||||
script:
|
||||
- npm install
|
||||
- npx playwright install
|
||||
- npx playwright test
|
||||
artifacts:
|
||||
paths:
|
||||
- test-results/
|
||||
expire_in: 1 week
|
||||
tags:
|
||||
- test
|
||||
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
|
||||
- docker # 这里要和注册 Runner 时的 `tag-list` 一致
|
||||
only:
|
||||
- main
|
||||
|
||||
Reference in New Issue
Block a user