45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: music-room Playwright (Gitea Actions)
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
playwright:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: 创建 .env.e2e
|
|
env:
|
|
MU: ${{ secrets.MOICEN_E2E_UNIONID }}
|
|
MAU: ${{ secrets.MOICEN_ADMIN_USER }}
|
|
MAP: ${{ secrets.MOICEN_ADMIN_PASSWORD }}
|
|
MHE: ${{ secrets.MOICEN_HEALTHCHECK_URL }}
|
|
run: |
|
|
cat > .env.e2e <<ENVEOF
|
|
MOICEN_E2E_UNIONID=${MU}
|
|
HUIKE_FRONT_BASE_URL=https://music-room.moicen.com
|
|
HUIKE_ADMIN_BASE_URL=https://admin.moicen.com
|
|
MOICEN_ADMIN_USER=${MAU}
|
|
MOICEN_ADMIN_PASSWORD=${MAP}
|
|
HTYTEACHER_BASE_URL=https://teacher.moicen.com
|
|
MOICEN_HEALTHCHECK_URL=${MHE}
|
|
ENVEOF
|
|
|
|
- name: 依赖与 Chromium
|
|
env:
|
|
PLAYWRIGHT_DOWNLOAD_HOST: https://npmmirror.com/mirrors/playwright/
|
|
run: |
|
|
# 腾讯云 CVM 内网镜像加速 apt
|
|
sed -i 's/deb.debian.org/mirrors.tencentyun.com/g' /etc/apt/sources.list
|
|
npm ci
|
|
npx playwright install chromium --with-deps
|
|
|
|
- name: Playwright 测试
|
|
env:
|
|
HUIKE_FRONT_BASE_URL: https://music-room.moicen.com
|
|
run: npx playwright test
|