-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (127 loc) · 4.06 KB
/
ci.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: ci
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
node-version:
- lts/iron
- lts/jod
env:
PUPPETEER_VERSION: 21.11.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache npm packages
uses: actions/cache@v4
with:
path: ${{ runner.os == 'Windows' && '~/AppData/Local/npm-cache/' || '~/.npm/' }}
key: npm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-${{ runner.os }}-${{ runner.arch }}
- name: Cache Puppeteer
uses: actions/cache@v4
with:
path: ~/.cache/puppeteer/
key: puppeteer-${{ runner.os }}-${{ runner.arch }}-${{ env.PUPPETEER_VERSION }}
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Codecov
uses: codecov/codecov-action@v5
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
integration:
runs-on: ${{ matrix.os }}
needs:
- build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
puppeteer-version:
- '18.2.1'
- '19.0.0'
- '19.1.1' # NOTE: Should've been 19.1.2 but there's no puppeteer-core@19.1.2
- '19.2.2'
- '19.3.0'
- '19.4.1'
- '19.5.2'
- '19.6.3'
- '19.7.5'
- '19.8.5'
- '19.9.1'
- '19.10.1'
- '19.11.1'
- '20.0.0'
- '20.1.2'
- '20.2.1'
- '20.3.0'
- '20.4.0'
- '20.5.0'
- '20.6.0'
- '20.7.4'
- '20.8.3'
- '20.9.0'
- '21.0.3'
- '21.1.1'
- '21.2.1'
- '21.3.8'
- '21.4.1'
- '21.5.2'
- '21.6.1'
- '21.7.0'
- '21.8.0'
- '21.9.0'
- '21.10.0'
- '21.11.0'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: X
run: npm config get cache
- name: Cache npm packages
uses: actions/cache@v4
with:
path: ${{ runner.os == 'Windows' && '~/AppData/Local/npm-cache/' || '~/.npm/' }}
key: npm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-${{ runner.os }}-${{ runner.arch }}
- name: Cache Puppeteer
uses: actions/cache@v4
with:
path: ~/.cache/puppeteer/
key: puppeteer-${{ runner.os }}-${{ runner.arch }}-${{ matrix.puppeteer-version }}
# NOTE: Chrome r112.0.5615.121 is not available on https://edgedl.me.gvt1.com, use 113.0.5672.63 from 20.1.0
- name: Override Chrome revision (for puppeteer@20.0.0)
if: ${{ matrix.puppeteer-version == '20.0.0' }}
run: |
echo "PUPPETEER_BROWSER_REVISION=113.0.5672.63" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }}
- name: Install Puppeteer ${{ matrix.puppeteer-version }}
run: npm install 'puppeteer@${{ matrix.puppeteer-version }}' 'puppeteer-core@${{ matrix.puppeteer-version }}'
- name: Install dependencies
run: npm ci
- name: Verify the Puppeteer and Puppeteer-Core versions
run: |
node -e "process.exit(require('puppeteer/package.json').version == '${{ matrix.puppeteer-version }}' ? 0 : 1)"
node -e "process.exit(require('puppeteer-core/package.json').version == '${{ matrix.puppeteer-version }}' ? 0 : 1)"
- name: Test
run: npm run test