42 lines
857 B
YAML
42 lines
857 B
YAML
stages:
|
|
- test
|
|
- report
|
|
|
|
playwright_tests:
|
|
stage: test
|
|
image: mcr.microsoft.com/playwright:focal
|
|
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-deps
|
|
- npx playwright install
|
|
- npx playwright test
|
|
artifacts:
|
|
paths:
|
|
- test-results/
|
|
expire_in: 1 week
|
|
tags:
|
|
- test # 指定使用标签为 test 的 Runner
|
|
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 # 指定使用标签为 test 的 Runner
|
|
only:
|
|
- main
|