Skip to content

Commit 8b14b10

Browse files
committed
Try existing github actions for firefox and geckodriver setup
1 parent 66b7985 commit 8b14b10

File tree

2 files changed

+44
-33
lines changed

2 files changed

+44
-33
lines changed

.github/workflows/test.yml

+43-32
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
runs-on: ubuntu-22.04
1414
strategy:
1515
matrix:
16-
job: [lint, firefox, edge-beta]
16+
job: [firefox]
17+
# job: [lint, firefox, edge-beta]
1718
include:
1819
- job: lint
1920
INFO: "lint"
@@ -43,37 +44,47 @@ jobs:
4344
with:
4445
node-version: '18.18.0' # Minimum version for eslint: https://eslint.org/docs/latest/use/getting-started
4546

46-
- name: Install Browser Dependencies # Firefox documentation
47-
run: |
48-
sudo apt update
49-
# Install Xvfb (replacing xvfb in Travis services)
50-
sudo apt-get install -y xvfb
51-
# Install browsers as needed:
52-
if [[ "${BROWSER}" == "firefox" ]]; then
53-
sudo install -d -m 0755 /etc/apt/keyrings
54-
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
55-
gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
56-
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
57-
echo '
58-
Package: *
59-
Pin: origin packages.mozilla.org
60-
Pin-Priority: 1000
61-
' | sudo tee /etc/apt/preferences.d/mozilla
62-
sudo apt-get update && sudo apt-get install firefox
63-
# Print the Firefox binary path
64-
echo "Firefox binary path:"
65-
which firefox
66-
ls -l "$(which firefox)"
67-
# Print the version to confirm it's installed correctly
68-
firefox --version
69-
elif [[ "${BROWSER}" == "microsoft-edge-beta" ]]; then
70-
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
71-
sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/
72-
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-beta.list'
73-
sudo rm microsoft.gpg
74-
sudo apt update
75-
sudo apt install microsoft-edge-beta
76-
fi
47+
- name: Set up Firefox
48+
if: matrix.job == 'firefox'
49+
uses: browser-actions/setup-firefox@v1
50+
with:
51+
firefox-version: 'latest'
52+
53+
- name: Install Gecko Driver
54+
if: matrix.job == 'firefox'
55+
uses: browser-actions/setup-geckodriver@latest
56+
run: geckodriver --version
57+
# - name: Install Browser Dependencies # Firefox documentation
58+
# run: |
59+
# sudo apt update
60+
# # Install Xvfb (replacing xvfb in Travis services)
61+
# sudo apt-get install -y xvfb
62+
# # Install browsers as needed:
63+
# if [[ "${BROWSER}" == "firefox" ]]; then
64+
# sudo install -d -m 0755 /etc/apt/keyrings
65+
# wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
66+
# gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
67+
# echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
68+
# echo '
69+
# Package: *
70+
# Pin: origin packages.mozilla.org
71+
# Pin-Priority: 1000
72+
# ' | sudo tee /etc/apt/preferences.d/mozilla
73+
# sudo apt-get update && sudo apt-get install firefox
74+
# # Print the Firefox binary path
75+
# echo "Firefox binary path:"
76+
# which firefox
77+
# ls -l "$(which firefox)"
78+
# # Print the version to confirm it's installed correctly
79+
# firefox --version
80+
# elif [[ "${BROWSER}" == "microsoft-edge-beta" ]]; then
81+
# curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
82+
# sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/
83+
# sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-beta.list'
84+
# sudo rm microsoft.gpg
85+
# sudo apt update
86+
# sudo apt install microsoft-edge-beta
87+
# fi
7788

7889
- name: Run Setup Script
7990
run: ./scripts/setup_travis.sh

scripts/setup_travis.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ case $INFO in
8484
;;
8585
*Firefox*)
8686
check_browser
87-
install_geckodriver
87+
# install_geckodriver
8888
install_python_deps
8989
;;
9090
*Edge*)

0 commit comments

Comments
 (0)