Skip to content

Commit 9381dc8

Browse files
committed
Modify gh wf to dynamically choose correct chromedriver version
1 parent de38ed0 commit 9381dc8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,24 @@ env:
1313
jobs:
1414
test:
1515
runs-on: ubuntu-latest
16-
16+
1717
steps:
1818
- uses: actions/checkout@v3
1919

20-
- name: Install Node.js
20+
- name: Set up Node.js
2121
uses: actions/setup-node@v3
2222
with:
2323
node-version: 18
2424

25-
- name: Clean install the project
25+
- name: Install dependencies
2626
run: npm ci
2727

28-
- name: Install ChromeDriver
29-
run: npm install chromedriver --detect_chromedriver_version
28+
- name: Install matching ChromeDriver
29+
run: |
30+
CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+' | head -1)
31+
CHROME_MAJOR_VERSION=$(echo "$CHROME_VERSION" | cut -d '.' -f 1)
32+
echo "Detected Chrome version: $CHROME_VERSION (major: $CHROME_MAJOR_VERSION)"
33+
npm install chromedriver@$CHROME_MAJOR_VERSION
3034
31-
- name: Execute all tests
35+
- name: Run tests
3236
run: npm run test:ci

0 commit comments

Comments
 (0)