@@ -32,17 +32,17 @@ jobs:
3232 - name : Install dependencies
3333 run : npm ci
3434
35- - name : Run tests
35+ - name : Run modern jest tests
3636 run : npm run task:jest
3737
38- # Run legacy tests on multiple matrix Node.js versions
39- run-tests-legacy-node13 :
38+ # Run tests on multiple matrix Node.js versions
39+ run-tests-modern-nodes :
4040 if : ${{ inputs.use-matrix == true }}
4141 runs-on : ubuntu-latest
42- needs : build-node13
42+ needs : build-modern
4343 strategy :
4444 matrix :
45- node-version : [7 .x, 8 .x, 9 .x, 10 .x, 11 .x, 12 .x, 13 .x]
45+ node-version : [16 .x, 17 .x, 18 .x, 19 .x, 20 .x, 21 .x, 22.x, 23 .x]
4646 steps :
4747 - uses : actions/checkout@v4
4848
@@ -51,27 +51,53 @@ jobs:
5151 with :
5252 path : |
5353 node_modules
54- tslib
55- key : ${{ runner.os }}-build-node13-${{ github.sha }}
56- restore-keys : |
57- ${{ runner.os }}-build-node13-
54+ key : ${{ runner.os }}-build-modern-${{ github.sha }}
5855
5956 - name : Use Node.js ${{ matrix.node-version }}
6057 uses : actions/setup-node@v4
6158 with :
6259 node-version : ${{ matrix.node-version }}
6360
64- - name : Build typescript to tslib
65- run : npm run ts2lib
61+ - name : Run modern jest tests
62+ run : npm run task:jest
6663
67- - name : Run tests
68- run : npm run task:jest:legacy
64+ # Run e2e tests
65+ run-e2e-tests :
66+ if : ${{ inputs.use-matrix == true }}
67+ runs-on : ubuntu-latest
68+ needs : build-modern
69+ steps :
70+ - uses : actions/checkout@v4
71+
72+ - name : Restore cache
73+ uses : actions/cache@v4
74+ with :
75+ path : |
76+ node_modules
77+ key : ${{ runner.os }}-build-modern-${{ github.sha }}
78+
79+ - name : Use Node.js ${{ vars.DEFAULT_NODE_VERSION }}
80+ uses : actions/setup-node@v4
81+ with :
82+ node-version : ${{ vars.DEFAULT_NODE_VERSION }}
83+
84+ - name : Install Playwright dependencies
85+ run : npx playwright install-deps webkit
86+
87+ - name : Install playwright browsers
88+ run : npx playwright install
89+
90+ - name : Build package
91+ run : npm run build
92+
93+ - name : Run e2e tests
94+ run : npm run e2e
6995
7096 # Run legacy tests on multiple matrix Node.js versions
71- run-tests-legacy-node15 :
97+ run-tests-legacy-node14-15 :
7298 if : ${{ inputs.use-matrix == true }}
7399 runs-on : ubuntu-latest
74- needs : build-node15
100+ needs : build-node14-15
75101 strategy :
76102 matrix :
77103 node-version : [14.x, 15.x]
@@ -84,29 +110,25 @@ jobs:
84110 path : |
85111 node_modules
86112 tslib
87- key : ${{ runner.os }}-build-node15-${{ github.sha }}
88- restore-keys : |
89- ${{ runner.os }}-build-node15-
113+ lib
114+ key : ${{ runner.os }}-build-node14-15-${{ github.sha }}
90115
91116 - name : Use Node.js ${{ matrix.node-version }}
92117 uses : actions/setup-node@v4
93118 with :
94119 node-version : ${{ matrix.node-version }}
95120
96- - name : Build typescript to tslib
97- run : npm run ts2lib
98-
99- - name : Run tests
121+ - name : Run legacy jest tests
100122 run : npm run task:jest:legacy
101123
102- # Run tests on multiple matrix Node.js versions
103- run-tests-modern-nodes :
124+ # Run legacy tests on multiple matrix Node.js versions
125+ run-tests-legacy-node7-13 :
104126 if : ${{ inputs.use-matrix == true }}
105127 runs-on : ubuntu-latest
106- needs : build-modern
128+ needs : build-node7-13
107129 strategy :
108130 matrix :
109- node-version : [16 .x, 17 .x, 18 .x, 19 .x, 20 .x, 21 .x, 22.x, 23 .x]
131+ node-version : [7 .x, 8 .x, 9 .x, 10 .x, 11 .x, 12 .x, 13 .x]
110132 steps :
111133 - uses : actions/checkout@v4
112134
@@ -115,24 +137,24 @@ jobs:
115137 with :
116138 path : |
117139 node_modules
118- key : ${{ runner.os }}-build-modern-${{ github.sha }}
119- restore-keys : |
120- ${{ runner.os }}-build-modern-
140+ tslib
141+ lib
142+ key : ${{ runner.os }}-build-node7-13-${{ github.sha }}
121143
122144 - name : Use Node.js ${{ matrix.node-version }}
123145 uses : actions/setup-node@v4
124146 with :
125147 node-version : ${{ matrix.node-version }}
126148
127- - name : Run tests
128- run : npm run task:jest
149+ - name : Run legacy jest tests
150+ run : npm run task:jest:legacy
129151
130152 # This job is used to run tests on legacy Node.js versions
131153 # 1. Use default Node.js
132154 # 2. Install older versions of jest and ts-jest
133155 # 3. Build the project
134156 # 4. Cache node_modules and tslib
135- build-node13 :
157+ build-node7-13 :
136158 if : ${{ inputs.use-matrix == true }}
137159 runs-on : ubuntu-latest
138160 steps :
@@ -145,12 +167,12 @@ jobs:
145167 cache : ' npm'
146168
147169 - name : Downgrade legacy dependencies
148- run : npm run prepare-legacy-node13
170+ run : npm run prepare-legacy-node7-13
149171
150172 - name : Install dependencies
151173 run : npm install --legacy-peer-deps --ignore-scripts --no-package-lock
152174
153- - name : Build
175+ - name : Build lib
154176 run : npm run build:lib
155177
156178 - name : Cache build output
@@ -159,16 +181,15 @@ jobs:
159181 path : |
160182 node_modules
161183 tslib
162- key : ${{ runner.os }}-build-node13-${{ github.sha }}
163- restore-keys : |
164- ${{ runner.os }}-build-node13-
184+ lib
185+ key : ${{ runner.os }}-build-node7-13-${{ github.sha }}
165186
166187 # This job is used to run tests on legacy Node.js versions
167188 # 1. Use default Node.js
168189 # 2. Install older versions of jest and ts-jest
169190 # 3. Build the project
170191 # 4. Cache node_modules and tslib
171- build-node15 :
192+ build-node14-15 :
172193 if : ${{ inputs.use-matrix == true }}
173194 runs-on : ubuntu-latest
174195 steps :
@@ -181,12 +202,12 @@ jobs:
181202 cache : ' npm'
182203
183204 - name : Downgrade legacy dependencies
184- run : npm run prepare-legacy-node15
205+ run : npm run prepare-legacy-node14-15
185206
186207 - name : Install dependencies
187208 run : npm install --legacy-peer-deps --ignore-scripts --no-package-lock
188209
189- - name : Build
210+ - name : Build lib
190211 run : npm run build:lib
191212
192213 - name : Cache build output
@@ -195,9 +216,8 @@ jobs:
195216 path : |
196217 node_modules
197218 tslib
198- key : ${{ runner.os }}-build-node15-${{ github.sha }}
199- restore-keys : |
200- ${{ runner.os }}-build-node15-
219+ lib
220+ key : ${{ runner.os }}-build-node14-15-${{ github.sha }}
201221
202222 # This job is used to run tests on modern Node.js versions
203223 # 1. Use default Node.js
@@ -224,5 +244,3 @@ jobs:
224244 path : |
225245 node_modules
226246 key : ${{ runner.os }}-build-modern-${{ github.sha }}
227- restore-keys : |
228- ${{ runner.os }}-build-modern-
0 commit comments