Merge pull request #1226 from tdonohue/fix_ci_issues

Add option to pin to a specific version of Chrome/ChromeDriver in our CI process
This commit is contained in:
Tim Donohue
2021-06-11 09:46:30 -05:00
committed by GitHub

View File

@@ -16,6 +16,9 @@ jobs:
DSPACE_REST_PORT: 8080
DSPACE_REST_NAMESPACE: '/server'
DSPACE_REST_SSL: false
# When Chrome version is specified, we pin to a specific version of Chrome & ChromeDriver
# Comment this out to use the latest release of both.
CHROME_VERSION: "90.0.4430.212-1"
strategy:
# Create a matrix of Node versions to test against (in parallel)
matrix:
@@ -34,10 +37,20 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install latest Chrome (for e2e tests)
# If CHROME_VERSION env variable specified above, then pin to that version.
# Otherwise, just install latest version of Chrome.
- name: Install Chrome (for e2e tests)
run: |
if [[ -z "${CHROME_VERSION}" ]]
then
echo "Installing latest stable version"
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable -y
else
echo "Installing version ${CHROME_VERSION}"
wget -q "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb"
sudo dpkg -i "google-chrome-stable_${CHROME_VERSION}_amd64.deb"
fi
google-chrome --version
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
@@ -53,8 +66,11 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install the latest chromedriver compatible with the installed chrome version
run: yarn global add chromedriver --detect_chromedriver_version
- name: Install latest ChromeDriver compatible with installed Chrome
# needs to be npm, the --detect_chromedriver_version flag doesn't work with yarn global
run: |
npm install -g chromedriver --detect_chromedriver_version
chromedriver -v
- name: Install Yarn dependencies
run: yarn install --frozen-lockfile