Skip to content

Commit

Permalink
Merge pull request #201 from nanasess/fallback-latest-version
Browse files Browse the repository at this point in the history
Fallback latest version
  • Loading branch information
nanasess authored Aug 4, 2023
2 parents 788c980 + 1451e03 commit 69cc01d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
os: [ ubuntu-latest, ubuntu-20.04, macos-latest, macos-11 ]
branch:
- 'master'
# - 'master'
- 'now'
chrome_version:
- 'current'
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
matrix:
os: [ ubuntu-latest, ubuntu-20.04, macos-latest, macos-11 ]
branch:
- 'master'
# - 'master'
- 'now'
steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:
fail-fast: false
matrix:
os: [ windows-latest, windows-2019 ]
branch: [ 'master', 'now' ]
branch:
# - 'master'
- 'now'
steps:
- uses: actions/checkout@v3
- shell: pwsh
Expand Down Expand Up @@ -69,7 +71,9 @@ jobs:
fail-fast: false
matrix:
os: [ windows-latest, windows-2019 ]
branch: [ 'master', 'now' ]
branch:
# - 'master'
- 'now'
steps:
- uses: actions/checkout@v3
- shell: pwsh
Expand Down
6 changes: 6 additions & 0 deletions lib/setup-chromedriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ else

echo "Installing ChromeDriver $VERSION for $ARCH"
URL=$(curl --location --fail --retry 10 https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq -r ".versions[] | select(.version == \"${VERSION}\") | .downloads.chromedriver[] | select(.platform == \"${ARCH}\") | .url")
if [ "$URL" == "" ]; then
echo "Fallback to latest version of ChromeDriver for $ARCH"
VERSION=$(curl --location --fail --retry 10 https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq -r ".versions[] | select(.version | startswith(\"$(echo $VERSION | cut -d '.' -f1-3).\")) | .version" | tail -1)
URL=$(curl --location --fail --retry 10 https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq -r ".versions[] | select(.version == \"${VERSION}\") | .downloads.chromedriver[] | select(.platform == \"${ARCH}\") | .url")
echo "Installing ChromeDriver $VERSION for $ARCH"
fi
echo "Downloading $URL"
curl --location --fail --retry 10 -O "$URL"
unzip -o -q chromedriver-${ARCH}.zip
Expand Down

0 comments on commit 69cc01d

Please sign in to comment.