-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (67 loc) · 3.05 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: test
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
id: setup-node
with:
node-version: 18
cache: 'yarn'
- name: Cache yarn
id: cache-yarn
uses: actions/cache@v3
with:
path: node_modules
key: yarn-lock-${{ hashFiles('yarn.lock') }}
- run: yarn install
- name: Setup FireFox
env:
FIREFOX_URL: https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US
run: |
ACTUAL_URL=$(curl -Ls -o /dev/null -w %{url_effective} $FIREFOX_URL)
curl --silent --show-error --location --fail --retry 3 --output /tmp/firefox.tar.bz2 $ACTUAL_URL
sudo tar -xvjf /tmp/firefox.tar.bz2 -C /opt
sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox
sudo apt-get install -y libgtk3.0-cil-dev libasound2 libasound2 libdbus-glib-1-2 libdbus-1-3
rm -rf /tmp/firefox.*
firefox --version
- name: Setup geckodriver
run: |
export GECKODRIVER_LATEST_RELEASE_URL=$(curl https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r ".assets[] | select(.name | test(\"linux64.tar.gz$\")) | .browser_download_url")
curl --silent --show-error --location --fail --retry 3 --output /tmp/geckodriver_linux64.tar.gz "$GECKODRIVER_LATEST_RELEASE_URL"
cd /tmp
tar xf geckodriver_linux64.tar.gz
rm -rf geckodriver_linux64.tar.gz
sudo mv geckodriver /usr/local/bin/geckodriver
sudo chmod +x /usr/local/bin/geckodriver
geckodriver --version
- name: Get Chrome
run: |
LAST_KNOWN_GOOD_VERSIONS_WITH_DL=$(curl -sL https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json)
CHROME_LINK=$( echo "$LAST_KNOWN_GOOD_VERSIONS_WITH_DL" | jq '.channels.Stable.downloads.chrome[] | select(.platform=="linux64")| .url' | sed s/\"//g )
curl -sL -o chrome-linux64.zip $CHROME_LINK
unzip chrome-linux64.zip
sudo mv chrome-linux64 /opt/chrome
sudo chmod +x /opt/chrome/chrome
ln /opt/chrome/chrome /usr/local/bin
chrome --version
- name: Get Chrome Driver
run: |
LAST_KNOWN_GOOD_VERSIONS_WITH_DL=$(curl -sL https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json)
CHROME_DRIVER_LINK=$( echo "$LAST_KNOWN_GOOD_VERSIONS_WITH_DL" | jq '.channels.Stable.downloads.chromedriver[] | select(.platform=="linux64")| .url' | sed s/\"//g )
echo "CHROME_DRIVER_LINK=${CHROME_DRIVER_LINK}"
curl -sL -o chrome-driver-linux64.zip $CHROME_DRIVER_LINK
unzip chrome-driver-linux64.zip
sudo mv chromedriver-linux64/chromedriver /usr/local/bin
chromedriver --version
- name: Setup Display
run: |
sudo apt-get install -y libxss1
- run: xvfb-run yarn test