Skip to content

Commit dcebbc1

Browse files
author
Codecloud
committed
ci: gpu-e2e 改用 setup-chrome(apt 装 Google Chrome 在 runner 上已失效)
- 原 apt + google-chrome-stable 方式在当前 runner 上失败,导致 gpu-e2e 整体挂掉 - 改用 browser-actions/setup-chrome,路径经 MOXWEBGPU_CHROME 传给测试脚本 - 自动定位 Chrome 自带的 SwiftShader Vulkan ICD 并导出 VK_ICD_FILENAMES - xvfb 仅在未预装时才 apt 安装,减少不必要的 apt-get update
1 parent dbe0902 commit dcebbc1

1 file changed

Lines changed: 31 additions & 6 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)