Testing Framwork #17
@@ -205,8 +205,7 @@ jobs:
|
|||||||
- name: Start app (background) + healthcheck
|
- name: Start app (background) + healthcheck
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
export PORT="${PORT:-3000}"
|
export PORT=3010 HOST=127.0.0.1
|
||||||
export HOST="127.0.0.1"
|
|
||||||
test -d .next || { echo "❌ Missing .next build output"; exit 1; }
|
test -d .next || { echo "❌ Missing .next build output"; exit 1; }
|
||||||
mkdir -p .next
|
mkdir -p .next
|
||||||
nohup npm run start -- -p "$PORT" -H "$HOST" > .next/runner.log 2>&1 &
|
nohup npm run start -- -p "$PORT" -H "$HOST" > .next/runner.log 2>&1 &
|
||||||
@@ -224,9 +223,29 @@ jobs:
|
|||||||
echo "––– .next/runner.log (tail) –––"
|
echo "––– .next/runner.log (tail) –––"
|
||||||
tail -n 200 .next/runner.log || true
|
tail -n 200 .next/runner.log || true
|
||||||
|
|
||||||
|
# ---- fixes begin here ----
|
||||||
|
- name: Ensure arm64 Node for LHCI
|
||||||
|
run: |
|
||||||
|
echo "node arch before: $(node -p "process.arch")"
|
||||||
|
if [ "$(node -p "process.arch")" != "arm64" ]; then
|
||||||
|
NODE_VER=20.17.0
|
||||||
|
curl -fsSLO https://nodejs.org/dist/v$NODE_VER/node-v$NODE_VER-darwin-arm64.tar.xz
|
||||||
|
tar -xJf node-v$NODE_VER-darwin-arm64.tar.xz
|
||||||
|
echo "$PWD/node-v$NODE_VER-darwin-arm64/bin" >> "$GITHUB_PATH"
|
||||||
|
echo "PATH updated to prefer arm64 node"
|
||||||
|
fi
|
||||||
|
echo "node arch after: $(node -p "process.arch")"
|
||||||
|
|
||||||
|
- name: Show arch & chrome info
|
||||||
|
run: |
|
||||||
|
echo "uname -m: $(uname -m)"
|
||||||
|
echo "node: $(node -v) arch=$(node -p "process.arch")"
|
||||||
|
"$CHROME_PATH" --version || true
|
||||||
|
|
||||||
- name: Run Lighthouse CI
|
- name: Run Lighthouse CI
|
||||||
run: npx lhci autorun --chrome-path="$CHROME_PATH"
|
run: npx lhci autorun --chrome-path="$CHROME_PATH" --collect.url=http://127.0.0.1:3010/
|
||||||
env: { CI: true }
|
env: { CI: true }
|
||||||
|
# ---- fixes end here ----
|
||||||
|
|
||||||
- name: Upload LHCI results
|
- name: Upload LHCI results
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"ci": {
|
"ci": {
|
||||||
"collect": {
|
"collect": {
|
||||||
"url": ["http://localhost:3000/"],
|
"url": ["http://127.0.0.1:3010/"],
|
||||||
"numberOfRuns": 3
|
"numberOfRuns": 3
|
||||||
},
|
},
|
||||||
"assert": {
|
"assert": {
|
||||||
|
|||||||
Reference in New Issue
Block a user