Skip to content

Commit

Permalink
Run packing in tests in parallel (#44048)
Browse files Browse the repository at this point in the history
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
3 people committed Dec 16, 2022
1 parent ab328c6 commit e239a41
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/actions/next-stats-action/src/prepare/repo-setup.js
Expand Up @@ -152,17 +152,19 @@ module.exports = (actionInfo) => {
await rootSpan
.traceChild('packing packages')
.traceAsyncFn(async (packingSpan) => {
for (const pkgName of pkgDatas.keys()) {
await packingSpan
.traceChild(`pack ${pkgName}`)
.traceAsyncFn(async () => {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
await exec(
`cd ${pkgPath} && yarn pack -f '${pkg}-packed.tgz'`,
true
)
})
}
await Promise.all(
Array.from(pkgDatas.keys()).map(async (pkgName) => {
await packingSpan
.traceChild(`pack ${pkgName}`)
.traceAsyncFn(async () => {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
await exec(
`cd ${pkgPath} && yarn pack -f '${pkg}-packed.tgz'`,
true
)
})
})
)
})

return pkgPaths
Expand Down

0 comments on commit e239a41

Please sign in to comment.