File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 shell : bash
4242 run : npm ci
4343
44- - name : Install Chrome Canary
45- shell : bash
46- run : |
47- CANARY_PATH=$(npx @puppeteer/browsers install chrome@canary --format "{{path}}")
48- echo "CANARY_EXECUTABLE_PATH=$CANARY_PATH" >> $GITHUB_ENV
49-
5044 - name : Build
5145 run : npm run bundle
5246 env :
Original file line number Diff line number Diff line change 77// Note: can be converted to ts file once node 20 support is dropped.
88// Node 20 does not support --experimental-strip-types flag.
99
10- import { spawn } from 'node:child_process' ;
10+ import { spawn , execSync } from 'node:child_process' ;
1111import path from 'node:path' ;
1212import process from 'node:process' ;
1313
@@ -58,6 +58,19 @@ const nodeArgs = [
5858 ...files ,
5959] ;
6060
61+ function installChrome ( version ) {
62+ try {
63+ return execSync (
64+ `npx @puppeteer/browsers install chrome@${ version } --format "{{path}}"` ,
65+ )
66+ . toString ( )
67+ . trim ( ) ;
68+ } catch ( e ) {
69+ console . error ( `Failed to install Chrome ${ version } :` , e ) ;
70+ process . exit ( 1 ) ;
71+ }
72+ }
73+
6174async function runTests ( attempt ) {
6275 if ( attempt > 1 ) {
6376 console . log ( `\nRun attempt ${ attempt } ...\n` ) ;
@@ -78,6 +91,9 @@ async function runTests(attempt) {
7891 } ) ;
7992}
8093
94+ const chromePath = installChrome ( '146.0.7680.31' ) ;
95+ process . env . CHROME_M146_EXECUTABLE_PATH = chromePath ;
96+
8197const maxAttempts = shouldRetry ? 3 : 1 ;
8298let exitCode = 1 ;
8399
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ describe('extension', () => {
149149 assert . ok ( pageTargetAfter , 'Page should exist after action' ) ;
150150 } ,
151151 {
152- executablePath : process . env . CANARY_EXECUTABLE_PATH ,
152+ executablePath : process . env . CHROME_M146_EXECUTABLE_PATH ,
153153 } ,
154154 {
155155 categoryExtensions : true ,
You can’t perform that action at this time.
0 commit comments