1
0
forked from baron/baron-sso

ci(userfront-e2e): add chromium fast lane

This commit is contained in:
2026-05-28 17:04:41 +09:00
parent 27caf27416
commit dc16958804
2 changed files with 41 additions and 5 deletions

View File

@@ -29,6 +29,11 @@ on:
required: true required: true
type: boolean type: boolean
default: true default: true
run_userfront_e2e_full:
description: "Run full userfront E2E browser matrix instead of Chromium fast lane"
required: true
type: boolean
default: false
run_adminfront_tests: run_adminfront_tests:
description: "Run adminfront Playwright tests" description: "Run adminfront Playwright tests"
required: true required: true
@@ -317,6 +322,8 @@ jobs:
if: ${{ always() && (github.event_name != 'workflow_dispatch' || inputs.run_userfront_e2e_tests == true) }} if: ${{ always() && (github.event_name != 'workflow_dispatch' || inputs.run_userfront_e2e_tests == true) }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 40 timeout-minutes: 40
env:
USERFRONT_E2E_FULL: ${{ github.event_name == 'workflow_dispatch' && inputs.run_userfront_e2e_full == true }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -420,7 +427,13 @@ jobs:
run: | run: |
set +e set +e
cd userfront-e2e cd userfront-e2e
npx playwright install --with-deps 2>&1 | tee ../reports/userfront-e2e-provision.log if [ "$USERFRONT_E2E_FULL" = "true" ]; then
provision_command="npx playwright install --with-deps"
else
provision_command="npx playwright install --with-deps chromium"
fi
echo "[userfront-e2e] $provision_command" | tee ../reports/userfront-e2e-provision.log
$provision_command 2>&1 | tee -a ../reports/userfront-e2e-provision.log
provision_exit_code=${PIPESTATUS[0]} provision_exit_code=${PIPESTATUS[0]}
cd .. cd ..
set -e set -e
@@ -435,7 +448,7 @@ jobs:
echo "- Exit Code: \`$provision_exit_code\`" echo "- Exit Code: \`$provision_exit_code\`"
echo echo
echo "## Command" echo "## Command"
echo "\`cd userfront-e2e && npx playwright install --with-deps\`" echo "\`cd userfront-e2e && $provision_command\`"
echo echo
echo "## Provision Log Tail (last 200 lines)" echo "## Provision Log Tail (last 200 lines)"
echo '```text' echo '```text'
@@ -450,7 +463,13 @@ jobs:
mkdir -p reports mkdir -p reports
set +e set +e
cd userfront-e2e cd userfront-e2e
npm test 2>&1 | tee ../reports/userfront-e2e-test.log if [ "$USERFRONT_E2E_FULL" = "true" ]; then
test_command="npm test"
else
test_command="npm test -- --project=chromium-desktop --project=chromium-mobile-webapp"
fi
echo "[userfront-e2e] $test_command" | tee ../reports/userfront-e2e-test.log
$test_command 2>&1 | tee -a ../reports/userfront-e2e-test.log
test_exit_code=${PIPESTATUS[0]} test_exit_code=${PIPESTATUS[0]}
cd .. cd ..
set -e set -e
@@ -467,8 +486,13 @@ jobs:
echo "1. \`cd userfront-e2e\`" echo "1. \`cd userfront-e2e\`"
echo "2. \`npm ci\`" echo "2. \`npm ci\`"
echo "3. \`cd ../userfront && flutter build web --wasm --release\`" echo "3. \`cd ../userfront && flutter build web --wasm --release\`"
echo "4. \`cd ../userfront-e2e && npx playwright install --with-deps\`" if [ "$USERFRONT_E2E_FULL" = "true" ]; then
echo "5. \`npm test\`" echo "4. \`cd ../userfront-e2e && npx playwright install --with-deps\`"
echo "5. \`npm test\`"
else
echo "4. \`cd ../userfront-e2e && npx playwright install --with-deps chromium\`"
echo "5. \`npm test -- --project=chromium-desktop --project=chromium-mobile-webapp\`"
fi
echo echo
echo "## Log Tail (last 200 lines)" echo "## Log Tail (last 200 lines)"
echo '```text' echo '```text'

View File

@@ -20,4 +20,16 @@ if grep -Fq -- "pnpm list -C ../common @playwright/test" "$WORKFLOW_FILE"; then
fail "Code Check workflow must not call pnpm list before pnpm install" fail "Code Check workflow must not call pnpm list before pnpm install"
fi fi
grep -Fq -- "run_userfront_e2e_full:" "$WORKFLOW_FILE" || \
fail "Code Check workflow must expose a manual full userfront-e2e switch"
grep -Fq -- "USERFRONT_E2E_FULL:" "$WORKFLOW_FILE" || \
fail "Code Check workflow must map the full userfront-e2e input into the job environment"
grep -Fq -- "npx playwright install --with-deps chromium" "$WORKFLOW_FILE" || \
fail "Userfront E2E fast lane must provision Chromium only"
grep -Fq -- "npm test -- --project=chromium-desktop --project=chromium-mobile-webapp" "$WORKFLOW_FILE" || \
fail "Userfront E2E fast lane must run only Chromium desktop and mobile projects"
echo "OK: Code Check Playwright cache keys do not depend on preinstalled node_modules" echo "OK: Code Check Playwright cache keys do not depend on preinstalled node_modules"