Fix performance test: use mac_arm platform and ensure arm64 Node for Lighthouse
CI Pipeline / test (18) (pull_request) Successful in 6m26s
CI Pipeline / test (20) (pull_request) Successful in 7m6s
CI Pipeline / e2e (chromium) (pull_request) Failing after 5m0s
CI Pipeline / e2e (firefox) (pull_request) Failing after 5m35s
CI Pipeline / e2e (webkit) (pull_request) Failing after 3m13s
CI Pipeline / visual-regression (pull_request) Failing after 5m50s
CI Pipeline / performance (pull_request) Failing after 4m26s
CI Pipeline / storybook (pull_request) Successful in 5m25s
CI Pipeline / lint (pull_request) Successful in 5m0s
CI Pipeline / build (pull_request) Successful in 2m15s
CI Pipeline / test (18) (pull_request) Successful in 6m26s
CI Pipeline / test (20) (pull_request) Successful in 7m6s
CI Pipeline / e2e (chromium) (pull_request) Failing after 5m0s
CI Pipeline / e2e (firefox) (pull_request) Failing after 5m35s
CI Pipeline / e2e (webkit) (pull_request) Failing after 3m13s
CI Pipeline / visual-regression (pull_request) Failing after 5m50s
CI Pipeline / performance (pull_request) Failing after 4m26s
CI Pipeline / storybook (pull_request) Successful in 5m25s
CI Pipeline / lint (pull_request) Successful in 5m0s
CI Pipeline / build (pull_request) Successful in 2m15s
This commit is contained in:
+26
-11
@@ -204,17 +204,31 @@ jobs:
|
|||||||
ls -la .next || true
|
ls -la .next || true
|
||||||
test -f .next/BUILD_ID || (echo "No Next build output (.next) – did build fail?" && exit 1)
|
test -f .next/BUILD_ID || (echo "No Next build output (.next) – did build fail?" && exit 1)
|
||||||
|
|
||||||
- name: Install portable Chrome (x64 to match Rosetta Node)
|
- name: Install Chrome via Puppeteer (mac_arm)
|
||||||
run: |
|
run: |
|
||||||
# Install x64 Chrome explicitly
|
set -euxo pipefail
|
||||||
npx @puppeteer/browsers install chrome@stable --platform mac_x64 -P .cache/puppeteer
|
mkdir -p .cache/puppeteer
|
||||||
# Compute the executable path for that platform
|
npx @puppeteer/browsers install chrome@stable \
|
||||||
CHROME_PATH="$(npx @puppeteer/browsers executable-path chrome@stable --platform mac_x64 -P .cache/puppeteer)"
|
--platform=mac_arm \
|
||||||
echo "Using Chrome at: $CHROME_PATH"
|
--path .cache/puppeteer
|
||||||
"$CHROME_PATH" --version
|
echo "CHROME_PATH=$(npx @puppeteer/browsers executable-path chrome@stable --platform=mac_arm --path .cache/puppeteer)" >> "$GITHUB_ENV"
|
||||||
# Make it available to later steps *and* this shell
|
|
||||||
echo "CHROME_PATH=$CHROME_PATH" >> "$GITHUB_ENV"
|
- name: Ensure arm64 Node for Lighthouse
|
||||||
export CHROME_PATH
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
echo "node before: $(node -v) arch=$(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"
|
||||||
|
# Make arm64 node take effect in THIS step:
|
||||||
|
export PATH="$PWD/node-v${NODE_VER}-darwin-arm64/bin:$PATH"
|
||||||
|
# And persist for subsequent steps:
|
||||||
|
echo "$PWD/node-v${NODE_VER}-darwin-arm64/bin" >> "$GITHUB_PATH"
|
||||||
|
fi
|
||||||
|
echo "node after: $(node -v) arch=$(node -p 'process.arch')"
|
||||||
|
echo "uname -m: $(uname -m)"
|
||||||
|
"${CHROME_PATH}" --version || true
|
||||||
|
|
||||||
- name: Performance (start + test + teardown)
|
- name: Performance (start + test + teardown)
|
||||||
run: |
|
run: |
|
||||||
@@ -231,11 +245,12 @@ jobs:
|
|||||||
curl -fsS "http://$HOST:$PORT" >/dev/null
|
curl -fsS "http://$HOST:$PORT" >/dev/null
|
||||||
echo "✅ App is responding at http://$HOST:$PORT"
|
echo "✅ App is responding at http://$HOST:$PORT"
|
||||||
|
|
||||||
|
# Ensure we're using arm64 Node for Lighthouse
|
||||||
echo "Node arch: $(node -p "process.arch")"
|
echo "Node arch: $(node -p "process.arch")"
|
||||||
echo "Chrome: $CHROME_PATH"
|
echo "Chrome: $CHROME_PATH"
|
||||||
"$CHROME_PATH" --version
|
"$CHROME_PATH" --version
|
||||||
|
|
||||||
# Run LHCI against the x64 Chrome we installed
|
# Run LHCI with arm64 Node + arm64 Chrome
|
||||||
npx lhci autorun --chrome-path="$CHROME_PATH" --collect.url=http://$HOST:$PORT/
|
npx lhci autorun --chrome-path="$CHROME_PATH" --collect.url=http://$HOST:$PORT/
|
||||||
|
|
||||||
kill "$SVPID" 2>/dev/null || true
|
kill "$SVPID" 2>/dev/null || true
|
||||||
|
|||||||
Reference in New Issue
Block a user