From da91501fb8dbce3735084339d80e92ff98f1b20b Mon Sep 17 00:00:00 2001 From: Jan Kaifer Date: Thu, 15 Dec 2022 13:21:35 +0100 Subject: [PATCH] Run packing in tests in parallel --- .../src/prepare/repo-setup.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/actions/next-stats-action/src/prepare/repo-setup.js b/.github/actions/next-stats-action/src/prepare/repo-setup.js index 493644727d6e..a76bc4dc24c1 100644 --- a/.github/actions/next-stats-action/src/prepare/repo-setup.js +++ b/.github/actions/next-stats-action/src/prepare/repo-setup.js @@ -129,16 +129,19 @@ module.exports = (actionInfo) => { // wait to pack packages until after dependency paths have been updated // to the correct versions - for (const pkgName of pkgDatas.keys()) { - const { pkg, pkgPath } = pkgDatas.get(pkgName) - await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`, true, { - env: { - // Yarn installed through corepack will not run in pnpm project without this env var set - // This var works for corepack >=0.15.0 - COREPACK_ENABLE_STRICT: '0', - }, + await Promise.all( + Array.from(pkgDatas.keys()).map(async (pkgName) => { + const { pkg, pkgPath } = pkgDatas.get(pkgName) + await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`, true, { + env: { + // Yarn installed through corepack will not run in pnpm project without this env var set + // This var works for corepack >=0.15.0 + COREPACK_ENABLE_STRICT: '0', + }, + }) }) - } + ) + return pkgPaths }, }