1
0
forked from baron/baron-sso

fix(ci): use npx playwright and fix adminfront scripts for reliable binary resolution in CI

This commit is contained in:
2026-05-15 13:59:51 +09:00
parent eff21aaa82
commit 16422f4e2e
3 changed files with 25 additions and 25 deletions

View File

@@ -61,8 +61,8 @@ find_available_port() {
'
}
playwright_install_cmd=(../common/node_modules/.bin/playwright install)
playwright_install_desc="../common/node_modules/.bin/playwright install"
playwright_install_cmd=(npx playwright install)
playwright_install_desc="npx playwright install"
playwright_project_args=()
has_webkit_host_dependencies() {
@@ -112,21 +112,21 @@ has_webkit_host_dependencies() {
}
if [ "$(id -u)" -eq 0 ]; then
playwright_install_cmd=(../common/node_modules/.bin/playwright install --with-deps)
playwright_install_desc="../common/node_modules/.bin/playwright install --with-deps"
playwright_install_cmd=(npx playwright install --with-deps)
playwright_install_desc="npx playwright install --with-deps"
elif command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then
playwright_install_cmd=(../common/node_modules/.bin/playwright install --with-deps)
playwright_install_desc="../common/node_modules/.bin/playwright install --with-deps"
playwright_install_cmd=(npx playwright install --with-deps)
playwright_install_desc="npx playwright install --with-deps"
elif ! has_webkit_host_dependencies; then
playwright_install_cmd=(../common/node_modules/.bin/playwright install chromium firefox)
playwright_install_desc="../common/node_modules/.bin/playwright install chromium firefox"
playwright_install_cmd=(npx playwright install chromium firefox)
playwright_install_desc="npx playwright install chromium firefox"
playwright_project_args=(--project=chromium --project=firefox)
{
echo "# Adminfront WebKit Skipped"
echo
echo "- Reason: WebKit host dependencies are not installed and this user cannot run passwordless sudo."
echo "- Action: Running Chromium and Firefox projects only."
echo "- To enable WebKit locally: run \`cd adminfront && ../common/node_modules/.bin/playwright install-deps webkit\` with sudo privileges."
echo "- To enable WebKit locally: run \`cd adminfront && npx playwright install-deps webkit\` with sudo privileges."
} > reports/adminfront-webkit-skipped.md
fi
@@ -197,7 +197,7 @@ echo "==> adminfront using PORT=$port"
(
cd "$tmp_dir/adminfront"
PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" \
../common/node_modules/.bin/playwright test "${playwright_project_args[@]}"
npx playwright test "${playwright_project_args[@]}"
) 2>&1 | tee reports/adminfront-test.log
test_exit_code=${PIPESTATUS[0]}
set -e
@@ -217,7 +217,7 @@ if [ "$test_exit_code" -ne 0 ]; then
echo "1. \`cd adminfront\`"
echo "2. \`npm install -g pnpm && pnpm install -C ../common\`"
echo "3. \`${playwright_install_desc}\`"
echo "4. \`../common/node_modules/.bin/playwright test\`"
echo "4. \`npx playwright test\`"
echo
echo "## Log Tail (last 200 lines)"
echo '```text'