generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 38
130 lines (128 loc) · 4.33 KB
/
test.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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