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,15 @@ const nodeArgs = [
5858 ...files ,
5959] ;
6060
61+ function installChrome ( version ) {
62+ try {
63+ return execSync ( `npx @puppeteer/browsers install chrome@${ version } --format "{{path}}"` ) . toString ( ) . trim ( ) ;
64+ } catch ( e ) {
65+ console . error ( `Failed to install Chrome ${ version } :` , e ) ;
66+ process . exit ( 1 ) ;
67+ }
68+ }
69+
6170async function runTests ( attempt ) {
6271 if ( attempt > 1 ) {
6372 console . log ( `\nRun attempt ${ attempt } ...\n` ) ;
@@ -78,6 +87,9 @@ async function runTests(attempt) {
7887 } ) ;
7988}
8089
90+ const chromePath = installChrome ( '146.0.7680.31' ) ;
91+ process . env . TRIGGER_ACTION_EXECUTABLE_PATH = chromePath ;
92+
8193const maxAttempts = shouldRetry ? 3 : 1 ;
8294let exitCode = 1 ;
8395
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 . TRIGGER_ACTION_EXECUTABLE_PATH ,
153153 } ,
154154 {
155155 categoryExtensions : true ,
You can’t perform that action at this time.
0 commit comments