From 36b45c6f507b5aabbb39df725efc7e88fae8ff61 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 24 Aug 2023 19:00:36 -0700 Subject: [PATCH] Break-up install and build steps for PR stats (#54536) Breaks up these commands to track down the timeout for release stats. x-ref: https://github.com/vercel/next.js/actions/runs/5969590815/job/16195862006 --- .../actions/next-stats-action/src/index.js | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/actions/next-stats-action/src/index.js b/.github/actions/next-stats-action/src/index.js index 094caa11afbde..3e66f1ca0c880 100644 --- a/.github/actions/next-stats-action/src/index.js +++ b/.github/actions/next-stats-action/src/index.js @@ -108,22 +108,24 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) { if (!actionInfo.skipClone) { const usePnpm = await fs.pathExists(path.join(dir, 'pnpm-lock.yaml')) - let buildCommand = `cd ${dir}${ - !statsConfig.skipInitialInstall - ? usePnpm - ? // --no-frozen-lockfile is used here to tolerate lockfile - // changes from merging latest changes - ` && pnpm install --no-frozen-lockfile && pnpm run build` - : ' && yarn install --network-timeout 1000000' - : '' - }` - - if (statsConfig.initialBuildCommand) { - buildCommand += ` && ${statsConfig.initialBuildCommand}` + if (!statsConfig.skipInitialInstall) { + await exec( + `cd ${dir}${ + usePnpm + ? // --no-frozen-lockfile is used here to tolerate lockfile + // changes from merging latest changes + ` && pnpm install --no-frozen-lockfile` + : ' && yarn install --network-timeout 1000000' + }`, + false + ) + + await exec( + statsConfig.initialBuildCommand || + `cd ${dir} && ${usePnpm ? 'pnpm build' : 'echo built'}`, + false + ) } - // allow high timeout for install + building all packages - // in case of noisy environment slowing down initial repo build - await exec(buildCommand, false, { timeout: 10 * 60 * 1000 }) } await fs