Skip to content

Commit

Permalink
Rework setup browser in workflows (#25620) (#25627)
Browse files Browse the repository at this point in the history
  • Loading branch information
timbset authored Sep 20, 2023
1 parent 87fa23f commit 96103db
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 33 deletions.
33 changes: 22 additions & 11 deletions .github/actions/run-qunit-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,22 @@ runs:
echo "MATRIX_ENVS_NAME_SAFE=$MATRIX_ENVS_NAME_SAFE"
echo "MATRIX_ENVS_NAME_SAFE=$MATRIX_ENVS_NAME_SAFE" >> $GITHUB_ENV
- name: Setup firefox profile
# - name: Update apt
# run: |
# sudo apt-get update

# - name: Setup utils
# run: |
# sudo apt-get install -y dbus-x11 httping x11vnc xvfb

- name: Setup Chrome
if: ${{ inputs.browser == 'chrome' }}
uses: ./.github/actions/setup-chrome
with:
chrome-version: '116.0.5845.110'

- name: Setup Firefox profile
if: ${{ inputs.browser == 'firefox' }}
shell: bash
run: |
mkdir -p /tmp/firefox-profile
Expand All @@ -53,16 +68,12 @@ runs:
'"font.name-list.sans-serif.x-western", "Liberation Sans"' \
'"font.name-list.serif.x-western", "Liberation Serif"' ; do echo "user_pref($p);" >> /tmp/firefox-profile/prefs.js; done
# - name: Update apt
# run: |
# sudo apt-get update

# - name: Setup utils
# run: |
# sudo apt-get install -y dbus-x11 httping x11vnc xvfb

- name: Pin browsers
uses: ./.github/actions/pin-browsers
- name: Setup Firefox
if: ${{ inputs.browser == 'firefox' }}
id: setup-firefox
uses: browser-actions/setup-firefox@v1
with:
firefox-version: '116.0.3'

- name: Use Node.js
uses: actions/setup-node@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
name: "Pin Browsers"
description: "Install and setup Chrome and Firefox"
name: Pin Browsers
description: Install and setup Chrome and Firefox

# List of browser versions
# Chrome: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
# Firefox: https://www.ubuntuupdates.org/package/ubuntu_mozilla_security/focal/main/base/firefox
# Chrome (ubuntu): https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
# Chrome versions: https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions

inputs:
chrome-version:
description: "Chrome version to install"
default: "116.0.5845.110-1"
firefox-version:
description: "Firefox version to install"
description: Chrome version to install
default: "latest"

runs:
using: composite
steps:
- name: "Setup latest Chrome"
- name: Setup latest Chrome
if: ${{ inputs.chrome-version == 'latest' }}
uses: browser-actions/setup-chrome@v1
with:
chrome-version: ${{ inputs.chrome-version }}
- name: "Print latest Chrome version"
shell: bash
- name: Print latest Chrome version
if: ${{ inputs.chrome-version == 'latest' }}
run: google-chrome-stable --version
- name: "Setup Chrome with specific version"
shell: bash
run: google-chrome-stable --version
- name: Setup Chrome with specific version
if: ${{ inputs.chrome-version != 'latest' }}
shell: bash
env:
CHROME_VERSION: ${{ inputs.chrome-version }}
run: |
if [ -n "$CHROME_VERSION" ]; then
curl -L "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" > /tmp/chrome.deb
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
sudo dpkg -i /tmp/chrome.deb
unlink /tmp/chrome.deb
google-chrome-stable --version
else
echo "Skip Chrome upgrade"
fi
- name: "Setup Firefox"
id: setup-firefox
uses: browser-actions/setup-firefox@v1
with:
firefox-version: ${{ inputs.firefox-version }}
10 changes: 8 additions & 2 deletions .github/workflows/devextreme_npm_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ jobs:
- name: Get sources
uses: actions/checkout@v4

- uses: ./.github/actions/pin-browsers
- name: Setup Chrome
uses: ./.github/actions/setup-chrome
with:
chrome-version: '116.0.5845.110'

- name: Create directory link
run: cd ../ && ln -s DevExtreme devextreme
Expand Down Expand Up @@ -214,7 +217,10 @@ jobs:
- name: Get sources
uses: actions/checkout@v4

- uses: ./.github/actions/pin-browsers
- name: Setup Chrome
uses: ./.github/actions/setup-chrome
with:
chrome-version: '116.0.5845.110'

- name: Use Node.js
uses: actions/setup-node@v3
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ jobs:
- name: Get sources
uses: actions/checkout@v4

- uses: ./.github/actions/pin-browsers
- name: Setup Chrome
uses: ./.github/actions/setup-chrome
with:
chrome-version: '116.0.5845.110'

- name: Use Node.js
uses: actions/setup-node@v3
Expand Down

0 comments on commit 96103db

Please sign in to comment.