@@ -49,15 +49,40 @@ jobs:
4949
5050 - run : pnpm install --frozen-lockfile
5151
52- - name : Install Chrome + xvfb
52+ # Chrome from the official action: the previous `apt install google-chrome-stable`
53+ # path broke on current runners (repo/signature churn). This one is pinned and
54+ # always yields a working binary.
55+ - name : Install Chrome
56+ id : chrome
57+ uses : browser-actions/setup-chrome@v1
58+
59+ - name : Install xvfb
5360 run : |
54- wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg
55- echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] https://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
56- sudo apt-get update
57- sudo apt-get install -y google-chrome-stable xvfb
61+ if command -v xvfb-run >/dev/null 2>&1; then
62+ echo "xvfb already present"
63+ else
64+ sudo apt-get update -qq
65+ sudo apt-get install -y -qq xvfb
66+ fi
5867
5968 - name : Build browser bundle
6069 run : pnpm build
6170
6271 - name : GPU end-to-end tests (SwiftShader)
63- run : pnpm test:gpu
72+ env :
73+ MOXWEBGPU_CHROME : ${{ steps.chrome.outputs.chrome-path }}
74+ run : |
75+ CHROME="${{ steps.chrome.outputs.chrome-path }}"
76+ CHROME_DIR="$(dirname "$CHROME")"
77+ # Chrome ships a SwiftShader Vulkan ICD next to the binary; point Vulkan
78+ # at it so WebGPU has a (software) adapter to talk to.
79+ for icd in \
80+ "$CHROME_DIR/vk_swiftshader_icd.json" \
81+ "$CHROME_DIR/../vk_swiftshader_icd.json" \
82+ "$CHROME_DIR/../../vk_swiftshader_icd.json"; do
83+ if [ -f "$icd" ]; then export VK_ICD_FILENAMES="$icd"; break; fi
84+ done
85+ echo "chrome = $CHROME"
86+ echo "VK_ICD_FILENAMES = ${VK_ICD_FILENAMES:-<unset, relying on Chrome fallback>}"
87+ "$CHROME" --version
88+ pnpm test:gpu
0 commit comments