diff --git a/build-system/common/update-packages.js b/build-system/common/update-packages.js index 568c9c5620405..ae29210acf949 100644 --- a/build-system/common/update-packages.js +++ b/build-system/common/update-packages.js @@ -269,12 +269,13 @@ function updatePackages() { * 2. During local development, do an incremental install if necessary. * 3. Since install scripts can be async, `await` the process object. * 4. Since script output is noisy, capture and print the stderr if needed. - * 5. During CI, make sure that the package files were correctly updated. + * 5. During CI, if not skipped, ensure package files were correctly updated. * * @param {string} dir + * @param {boolean=} skipNpmChecks * @return {Promise} */ -async function updateSubpackages(dir) { +async function updateSubpackages(dir, skipNpmChecks = false) { const results = checkDependencies.sync({packageDir: dir}); const relativeDir = path.relative(process.cwd(), dir); if (results.depsWereOk) { @@ -289,7 +290,7 @@ async function updateSubpackages(dir) { throw new Error('Installation failed'); } } - if (isCiBuild()) { + if (isCiBuild() && !skipNpmChecks) { runNpmChecks(dir); } } diff --git a/build-system/tasks/check-build-system.js b/build-system/tasks/check-build-system.js index e93b482573300..4a43ffd976271 100644 --- a/build-system/tasks/check-build-system.js +++ b/build-system/tasks/check-build-system.js @@ -22,11 +22,13 @@ const {updateSubpackages} = require('../common/update-packages'); /** * Helper that updates build-system subpackages so their types can be verified. + * Skips NPM checks during CI (already done while running each task). */ async function updateBuildSystemSubpackages() { const packageFiles = globby.sync('build-system/tasks/*/package.json'); for (const packageFile of packageFiles) { - await updateSubpackages(path.dirname(packageFile)); + const packageDir = path.dirname(packageFile); + await updateSubpackages(packageDir, /* skipNpmChecks */ true); } }