Skip to content

Commit 5d9018f

Browse files
committed
ci: provision Chrome via setup-chrome on ubuntu-24.04 for VRT + Percy
Revert the ubuntu-22.04 pin (unnecessary: deleting the puppeteer install step removes the ~/.cache/puppeteer husk issue, and --no-sandbox in both launchers makes the 24.04 AppArmor workaround moot — so 24.04 works and avoids the 22.04 deprecation track). Provision Chrome explicitly with browser-actions/setup-chrome (SHA-pinned) and point PUPPETEER_EXECUTABLE_PATH + PERCY_BROWSER_EXECUTABLE at it, instead of relying on the runner's rolling-latest Chrome. Using chrome-version: stable for now; will pin a specific build for reproducible Percy snapshots once green.
1 parent 2f14bbb commit 5d9018f

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ permissions:
1616

1717
jobs:
1818
build_lint_and_test:
19-
# Pinned to 22.04: the current 24.04 runner image ships a partial
20-
# ~/.cache/puppeteer that breaks `puppeteer browsers install`, and needs an
21-
# AppArmor `aa-exec` workaround for Chrome's sandbox. 22.04 has neither, so
22-
# the job runs without those workarounds.
23-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2420

2521
steps:
2622
- name: Checkout
@@ -71,22 +67,27 @@ jobs:
7167
- name: Building Visual Regression Tests application for UI components
7268
run: pnpm visual-testing-app:build
7369

74-
# Both the visual-test browser (jest-puppeteer) and Percy's asset-discovery
75-
# browser need a Chrome. Their pinned runtime downloads both fail in CI now
76-
# — Puppeteer's Chrome-for-Testing 127.0.6533.88 and Percy's Chromium
77-
# snapshot 1300309 (pruned from the public bucket) — which yielded 0
78-
# snapshots. Use the runner's pre-installed Chrome for both instead of
79-
# downloading. jest-puppeteer.config.js already reads
70+
# The visual-test browser (jest-puppeteer) and Percy's asset-discovery
71+
# browser both need a Chrome. Puppeteer's and Percy's own pinned downloads
72+
# (Chrome-for-Testing 127.0.6533.88 / Percy Chromium snapshot 1300309) stopped
73+
# working in CI and yielded 0 snapshots, so we provision Chrome explicitly
74+
# here and point both tools at it. jest-puppeteer.config.js reads
8075
# PUPPETEER_EXECUTABLE_PATH and launches with --no-sandbox.
76+
# TODO: pin `chrome-version` to a specific build for reproducible snapshots.
77+
- name: Set up Chrome
78+
id: setup-chrome
79+
uses: browser-actions/setup-chrome@2e1d749697dd1612b833dba4a722266286fbefcd # v2.1.2
80+
with:
81+
chrome-version: stable
82+
8183
- name: Running Visual Regression Tests for UI components
8284
run: |
83-
CHROME="$(command -v google-chrome google-chrome-stable chromium-browser 2>/dev/null | head -1)"
84-
echo "Using Chrome for VRT + Percy: ${CHROME:?no Chrome found on runner}"
85-
export PUPPETEER_EXECUTABLE_PATH="$CHROME"
86-
export PERCY_BROWSER_EXECUTABLE="$CHROME"
85+
echo "Using Chrome ${{ steps.setup-chrome.outputs.chrome-version }} at $PUPPETEER_EXECUTABLE_PATH"
8786
pnpm vrt:components
8887
timeout-minutes: 20
8988
env:
89+
PUPPETEER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
90+
PERCY_BROWSER_EXECUTABLE: ${{ steps.setup-chrome.outputs.chrome-path }}
9091
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
9192

9293

0 commit comments

Comments
 (0)