forked from shaka-project/webdriver-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 2.01 KB
/
test-gha.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
debug_enabled:
description: 'Enable tmate debugging'
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || inputs.ref }}
cancel-in-progress: true
name: Test in GitHub Actions Environment
jobs:
check-driver-installation:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# Disable fail-fast so that one matrix-job failing doesn't make the other
# ones end early. We want to see the results on all platforms.
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: node ./main.js
- name: Check installed drivers
shell: bash
run: |
check_driver() {
local driver="$1"
if ! ./$driver --version &>/dev/null; then
echo "::error::$driver not found on ${{ runner.os }}!"
return 1
fi
}
rv=0
if [[ "${{ runner.os }}" == "macOS" ]]; then
check_driver chromedriver || rv=1
check_driver geckodriver || rv=1
check_driver msedgedriver || rv=1
elif [[ "${{ runner.os }}" == "Linux" ]]; then
check_driver chromedriver || rv=1
check_driver geckodriver || rv=1
elif [[ "${{ runner.os }}" == "Windows" ]]; then
check_driver chromedriver.exe || rv=1
check_driver geckodriver.exe || rv=1
check_driver msedgedriver.exe || rv=1
fi
exit "$rv"
- uses: mxschmitt/action-tmate@v3
if: ${{ failure() && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}