Skip to content

Commit b4e8097

Browse files
authored
CI: Skip chrome deps setup in shr2 (#31167)
1 parent 634d056 commit b4e8097

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

.github/actions/setup-chrome-headless-shell/action.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ runs:
1717
env:
1818
CHROME_VERSION: ${{ inputs.chrome-version }}
1919
run: |
20-
if [ -n "$CHROME_VERSION" ]; then
21-
sudo apt-get update
22-
sudo apt-get -y install libu2f-udev
23-
sudo apt-get -y install dbus
24-
20+
if [ -n "$CHROME_VERSION" ]; then
2521
echo "version to install: $CHROME_VERSION"
2622
CHROME_BIN=`npx @puppeteer/browsers install chrome-headless-shell@$CHROME_VERSION | awk '{print $2}'`
2723
chmod +x $CHROME_BIN

.github/actions/setup-chrome/action.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ inputs:
99
chrome-version:
1010
description: Chrome version to install
1111
default: "latest"
12+
runner-type:
13+
description: Runner type, 'github-hosted' of 'self-hosted'
14+
default: "self-hosted"
1215

1316
runs:
1417
using: composite
@@ -27,10 +30,14 @@ runs:
2730
shell: bash
2831
env:
2932
CHROME_VERSION: ${{ inputs.chrome-version }}
33+
RUNNER_TYPE: ${{ inputs.runner-type }}
3034
run: |
31-
if [ -n "$CHROME_VERSION" ]; then
32-
sudo apt-get update
33-
sudo apt-get -y install libu2f-udev
35+
CURRENT_CHROME_VERSION=$(google-chrome-stable --product-version)
36+
if [[ -n "$CHROME_VERSION" && "$CURRENT_CHROME_VERSION" != "$CHROME_VERSION" ]]; then
37+
if [ "$RUNNER_TYPE" = "github_hosted" ]; then
38+
sudo apt-get update
39+
sudo apt-get -y install libu2f-udev
40+
fi
3441
curl -L "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" > /tmp/chrome.deb
3542
sudo dpkg -i /tmp/chrome.deb
3643
unlink /tmp/chrome.deb

.github/workflows/demos_visual_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
uses: ./.github/actions/setup-chrome
8484
with:
8585
chrome-version: '133.0.6943.53'
86+
runner-type: 'github-hosted'
8687

8788
- name: Use Node.js
8889
uses: actions/setup-node@v4

.github/workflows/demos_visual_tests_frameworks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ jobs:
423423
uses: ./.github/actions/setup-chrome
424424
with:
425425
chrome-version: '133.0.6943.53'
426+
runner-type: 'github-hosted'
426427

427428
- name: Use Node.js
428429
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)