Add chromeapp input variable #810
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test chromedriver on *NIX" | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
paths: | |
- '**' | |
- '!*.md' | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- '**' | |
- '!*.md' | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- ubuntu-24.04 | |
- ubuntu-22.04 | |
- ubuntu-20.04 | |
- macos-latest | |
- macos-14 | |
- macos-13 | |
- macos-12 | |
branch: | |
# - 'master' | |
- 'now' | |
chrome_version: | |
- 'current' | |
# FIXME https://github.com/nanasess/setup-chromedriver/issues/229 | |
# - '114.0.5735.90' | |
steps: | |
- uses: actions/checkout@v4 | |
- if: startsWith(matrix.os, 'ubuntu') | |
run: echo 'CHROMEAPP=google-chrome' >> $GITHUB_ENV | |
- if: startsWith(matrix.os, 'macos') | |
run: echo 'CHROMEAPP=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' >> $GITHUB_ENV | |
- run: yarn install --frozen-lockfile | |
- run: yarn build | |
- run: yarn package | |
- run: yarn test | |
# - run: | | |
# node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts | |
# # Cannot find chromedriver when using ncc. | |
# # see https://github.com/nanasess/setup-chromedriver/issues/303 | |
# # node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ | |
# # rm -rf node_modules | |
- if: matrix.chrome_version != 'current' | |
env: | |
CHROME_VERSION: ${{ matrix.chrome_version }} | |
run: | | |
CHROME_VERSION=$(echo $CHROME_VERSION | cut -d '.' -f 1) | |
echo "CHROMEDRIVER_VERSION=$(curl --location --fail --retry 10 http://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION})" >> $GITHUB_ENV | |
- if: matrix.chrome_version == 'current' && startsWith(matrix.os, 'ubuntu') | |
run: | | |
CHROME_VERSION=$("$CHROMEAPP" --version | cut -f 3 -d ' ') | |
echo "CHROMEDRIVER_VERSION=$CHROME_VERSION" >> $GITHUB_ENV | |
- if: matrix.chrome_version == 'current' && startsWith(matrix.os, 'maos') | |
env: | |
CHROME_VERSION: '114.0.5735.90' | |
run: | | |
CHROME_VERSION=$(echo $CHROME_VERSION | cut -d '.' -f 1) | |
echo "CHROMEDRIVER_VERSION=$CHROME_VERSION" >> $GITHUB_ENV | |
- uses: ./ | |
if: matrix.branch == 'now' | |
with: | |
chromedriver-version: ${{ env.CHROMEDRIVER_VERSION }} | |
- uses: nanasess/setup-chromedriver@master | |
if: matrix.branch == 'master' | |
with: | |
chromedriver-version: ${{ env.CHROMEDRIVER_VERSION }} | |
- name: setup | |
run: | | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # disable headless mode | |
node_modules/.bin/ts-node $GITHUB_WORKSPACE/__tests__/chromedriver.ts | |
test_default_version: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- ubuntu-24.04 | |
- ubuntu-22.04 | |
- ubuntu-20.04 | |
- macos-latest | |
- macos-14 | |
- macos-13 | |
- macos-12 | |
branch: | |
# - 'master' | |
- 'now' | |
steps: | |
- uses: actions/checkout@v4 | |
- if: startsWith(matrix.os, 'ubuntu') | |
run: echo 'CHROMEAPP=google-chrome' >> $GITHUB_ENV | |
- if: startsWith(matrix.os, 'macos') | |
run: echo 'CHROMEAPP=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' >> $GITHUB_ENV | |
- run: yarn install --frozen-lockfile | |
- run: yarn build | |
- run: yarn package | |
- run: yarn test | |
# - run: | | |
# node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts | |
# # Cannot find chromedriver when using ncc. | |
# # see https://github.com/nanasess/setup-chromedriver/issues/303 | |
# # node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__ | |
# rm -rf node_modules | |
- uses: ./ | |
if: matrix.branch == 'now' | |
- uses: nanasess/setup-chromedriver@master | |
if: matrix.branch == 'master' | |
- name: setup | |
run: | | |
"$CHROMEAPP" --version | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # disable headless mode | |
node_modules/.bin/ts-node $GITHUB_WORKSPACE/__tests__/chromedriver.ts |