Skip to content

Commit

Permalink
Break-up install and build steps for PR stats (#54536)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ijjk authored Aug 25, 2023
1 parent 7ac6bb1 commit 36b45c6
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/actions/next-stats-action/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36b45c6

Please sign in to comment.