Skip to content

Commit 7eab4fd

Browse files
committed
chore(ci): move the ls check inside the install script so that it can re-run on windows
1 parent 58562e7 commit 7eab4fd

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.evergreen/functions.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,9 @@ functions:
193193
npm config ls -l
194194
echo "(if npm fails, debug.log will be uploaded to S3)"
195195
196-
# Install dependencies
196+
# Install and check dependencies
197197
bash ".evergreen/retry-with-backoff.sh" .evergreen/npm_ci.sh
198198
199-
# Will fail if versions of direct dependencies listed in package-lock
200-
# are not matching versions defined in package.json file of any of the
201-
# workspace packages
202-
# This command is very noisy when running from root with --all, store
203-
# the output in a file that will be uploaded with rest of the logs
204-
LS_ALL_STDOUT_FILE="$(npm config get cache)/_logs/$(date -u +"%Y-%m-%dT%H_%M_%SZ")-npm-ls-all.log"
205-
echo "Validating dependencies with \`npm ls --all\`..."
206-
(npm ls --all > $LS_ALL_STDOUT_FILE && echo "No mismatched dependency versions") || (echo "\nThe \`npm ls\` command failed with mismatched dependencies error. This usually means that the dependency versions listed in package.json are not matching dependencies resolved and recorded in package-lock.json. If you updated package.json files in your PR, inspect the error output and try to re-install offending dependncies to fix the package-lock file." && exit 1)
207-
208199
bootstrap:
209200
- command: shell.exec
210201
type: setup

.evergreen/npm_ci.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ find configs -name 'node_modules' -type d -prune -exec rm -rf '{}' +
1111
find packages -name 'node_modules' -type d -prune -exec rm -rf '{}' +
1212
find scripts -name 'node_modules' -type d -prune -exec rm -rf '{}' +
1313
npm ci --unsafe-perm
14+
15+
# Will fail if versions of direct dependencies listed in package-lock are not
16+
# matching versions defined in package.json file of any of the workspace
17+
# packages. This command is very noisy when running from root with --all, store
18+
# the output in a file that will be uploaded with rest of the logs
19+
LS_ALL_STDOUT_FILE="$(npm config get cache)/_logs/$(date -u +"%Y-%m-%dT%H_%M_%SZ")-npm-ls-all.log"
20+
echo "Validating dependencies with \`npm ls --all\`..."
21+
(npm ls --all >$LS_ALL_STDOUT_FILE && echo "No mismatched dependency versions") || (echo ""; echo "The \`npm ls\` command failed with mismatched dependencies error. This usually means that the dependency versions listed in package.json are not matching dependencies resolved and recorded in package-lock.json. If you updated package.json files in your PR, inspect the error output and try to re-install offending dependncies to fix the package-lock file." && exit 1)

0 commit comments

Comments
 (0)