generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 38
97 lines (95 loc) · 3 KB
/
windows.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
name: "Test chromedriver on Windows"
on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
branches:
- '*'
paths:
- '**'
- '!*.md'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, windows-2019 ]
branch:
# - 'master'
- 'now'
steps:
- uses: actions/checkout@v4
- shell: pwsh
run: echo "CHROMEAPP=C:\Program Files\Google\Chrome\Application\chrome.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn package
- run: yarn test
- run: |
node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts
node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__
rm -rf node_modules
shell: bash
- shell: pwsh
run: |
$chrome_fullversion = (Get-Item $Env:CHROMEAPP).VersionInfo.FileVersion
$chrome_majorversion = $chrome_fullversion.Split(".")[0]
if($chrome_majorversion -lt 115)
{
$response = Invoke-WebRequest "http://chromedriver.storage.googleapis.com/LATEST_RELEASE_$chrome_majorversion"
$version = $response.Content
echo "CHROMEDRIVER_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
else
{
echo "CHROMEDRIVER_VERSION=$chrome_fullversion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
- 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: |
chromedriver --url-base=/wd/hub &
node "$Env:GITHUB_WORKSPACE\__tests__\index.js"
test_default_version:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, windows-2019 ]
branch:
# - 'master'
- 'now'
steps:
- uses: actions/checkout@v4
- shell: pwsh
run: echo "CHROMEAPP=C:\Program Files\Google\Chrome\Application\chrome.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn package
- run: yarn test
- run: |
node_modules/.bin/tsc $GITHUB_WORKSPACE/__tests__/chromedriver.ts
node_modules/.bin/ncc build $GITHUB_WORKSPACE/__tests__/chromedriver.js -o $GITHUB_WORKSPACE/__tests__
rm -rf node_modules
shell: bash
- uses: ./
if: matrix.branch == 'now'
- uses: nanasess/setup-chromedriver@master
if: matrix.branch == 'master'
- name: setup
run: |
chromedriver --url-base=/wd/hub &
node "$Env:GITHUB_WORKSPACE\__tests__\index.js"