mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
Skip duplicate check only applies to development branches now. Main and canary branches will always execute E2E tests on every commit. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
95 lines
2.4 KiB
YAML
95 lines
2.4 KiB
YAML
name: E2E CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
|
DATABASE_DRIVER: node
|
|
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
|
AUTH_SECRET: e2e-test-secret-key-for-better-auth-32chars!
|
|
AUTH_EMAIL_VERIFICATION: '0'
|
|
# Mock S3 env vars to prevent initialization errors
|
|
S3_ACCESS_KEY_ID: e2e-mock-access-key
|
|
S3_SECRET_ACCESS_KEY: e2e-mock-secret-key
|
|
S3_BUCKET: e2e-mock-bucket
|
|
S3_ENDPOINT: https://e2e-mock-s3.localhost
|
|
|
|
jobs:
|
|
# Check for duplicate runs
|
|
check-duplicate-run:
|
|
name: Check Duplicate Run
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
|
steps:
|
|
- id: skip_check
|
|
uses: fkirc/skip-duplicate-actions@v5
|
|
with:
|
|
concurrent_skipping: 'same_content_newer'
|
|
skip_after_successful_duplicate: 'true'
|
|
do_not_skip: '["workflow_dispatch", "schedule"]'
|
|
|
|
e2e:
|
|
needs: check-duplicate-run
|
|
if: >-
|
|
github.ref == 'refs/heads/main' ||
|
|
github.ref == 'refs/heads/canary' ||
|
|
needs.check-duplicate-run.outputs.should_skip != 'true'
|
|
name: Test Web App
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: paradedb/paradedb:latest
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
ports:
|
|
- 5432:5432
|
|
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies (bun)
|
|
run: bun install
|
|
|
|
- name: Install Playwright browsers (with system deps)
|
|
run: bunx playwright install --with-deps chromium
|
|
|
|
- name: Run database migrations
|
|
run: bun run db:migrate
|
|
|
|
- name: Build application
|
|
run: bun run build
|
|
env:
|
|
SKIP_LINT: '1'
|
|
|
|
- name: Run E2E tests
|
|
run: bun run e2e
|
|
|
|
- name: Upload E2E test artifacts (on failure)
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: e2e-artifacts
|
|
path: |
|
|
e2e/reports
|
|
e2e/screenshots
|
|
if-no-files-found: ignore
|