1
0
forked from baron/baron-sso
Files
baron-sso/test/code_check_playwright_cache_policy_test.sh
2026-05-21 08:46:08 +09:00

24 lines
763 B
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
WORKFLOW_FILE="$ROOT_DIR/.gitea/workflows/code_check.yml"
fail() {
echo "ERROR: $*" >&2
exit 1
}
grep -Fq -- "scripts/playwrightPackageVersion.cjs" "$WORKFLOW_FILE" || \
fail "Code Check workflow must compute Playwright cache versions through the shared package.json reader"
if grep -Fq -- "npm list @playwright/test" "$WORKFLOW_FILE"; then
fail "Code Check workflow must not call npm list before npm ci"
fi
if grep -Fq -- "pnpm list -C ../common @playwright/test" "$WORKFLOW_FILE"; then
fail "Code Check workflow must not call pnpm list before pnpm install"
fi
echo "OK: Code Check Playwright cache keys do not depend on preinstalled node_modules"