bc85888359
Made-with: Cursor
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
# 仅 npm + Playwright,不 build Rust / 不 Compose;测已部署 music-room H5。
|
|
name: music-room Playwright
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
inputs:
|
|
base_url:
|
|
description: H5 基址(含协议,无末尾斜杠)
|
|
required: false
|
|
default: "https://music-room.moicen.com"
|
|
type: string
|
|
schedule:
|
|
# 每天 06:30 UTC 对默认 H5 跑一遍(北京时间约 14:30)
|
|
- cron: "30 6 * * *"
|
|
|
|
concurrency:
|
|
group: huike-e2e-moicen-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
playwright:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: 解析 H5 基址
|
|
run: |
|
|
URL="${{ inputs.base_url }}"
|
|
if [ -z "$URL" ]; then URL="https://music-room.moicen.com"; fi
|
|
echo "HUIKE_FRONT_BASE_URL=$URL" >> "$GITHUB_ENV"
|
|
echo "Using HUIKE_FRONT_BASE_URL=$URL"
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: 依赖与 Chromium
|
|
run: |
|
|
npm ci
|
|
npx playwright install chromium --with-deps
|
|
|
|
- name: Playwright
|
|
env:
|
|
MOICEN_E2E_UNIONID: ${{ secrets.MOICEN_E2E_UNIONID }}
|
|
run: npx playwright test
|