Skip to content

Update tests.yml

Update tests.yml #267

Workflow file for this run

name: Continuous Integration
on:
push:
branches: [ master, pp/chrome-driver-integration-failure ]
pull_request:
branches: [ master, pp/chrome-driver-integration-failure ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: browser-actions/setup-chrome@latest
with:
chrome-version: latest
- name: Download ChromeDriver
run: |
# Get the full Chrome version
CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+\.\d+')
echo "Chrome version: $CHROME_VERSION"
# Get the major version of Chrome
CHROME_MAJOR_VERSION=$(echo $CHROME_VERSION | cut -d '.' -f 1)
echo "Chrome major version: $CHROME_MAJOR_VERSION"
# Get the ChromeDriver version that matches the Chrome major version
CHROMEDRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAJOR_VERSION)
echo "ChromeDriver version: $CHROMEDRIVER_VERSION"
# Verify the ChromeDriver version was fetched correctly
if [ -z "$CHROMEDRIVER_VERSION" ]; then
echo "Failed to fetch ChromeDriver version"
exit 1
fi
# Download and unzip the ChromeDriver
curl -sS -o /tmp/chromedriver.zip "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
unzip -q /tmp/chromedriver.zip -d /tmp
# Move ChromeDriver to a location in PATH
sudo mv /tmp/chromedriver /usr/local/bin/chromedriver
sudo chmod +x /usr/local/bin/chromedriver
- run: npm ci
- run: npx grunt
- run: npm test