文件

89 行
2.2 KiB
YAML

name: ci-e2e
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: "10 19 * * *"
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 60
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: hyb_oa
POSTGRES_USER: hyboa_user
POSTGRES_PASSWORD: hyboa_password
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U hyboa_user -d hyb_oa"
--health-interval=10s
--health-timeout=5s
--health-retries=10
env:
QA_DB_HOST: 127.0.0.1
QA_DB_PORT: 5432
QA_DB_USER: hyboa_user
QA_DB_PASSWORD: hyboa_password
QA_DB_ADMIN_DB: postgres
QA_PORT: 3000
QA_HOST: 127.0.0.1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select gate mode
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "WEB_GATE_MODE=smoke-local" >> "$GITHUB_ENV"
else
echo "WEB_GATE_MODE=full-local" >> "$GITHUB_ENV"
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: |
server/package-lock.json
client/package-lock.json
- name: Install server dependencies
working-directory: server
run: npm ci
- name: Install client dependencies
working-directory: client
run: npm ci
- name: Install PostgreSQL client
run: sudo apt-get update && sudo apt-get install -y postgresql-client
- name: Install Playwright browsers
working-directory: client
run: npx playwright install --with-deps
- name: Run web gate
run: bash scripts/qa/run-web-gates.sh "$WEB_GATE_MODE"
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ env.WEB_GATE_MODE }}-${{ github.run_id }}
path: |
client/playwright-report
client/test-results
if-no-files-found: ignore