Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pnpm install script for large PRs #67460

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Expand Up @@ -44,6 +44,8 @@ jobs:
- run: ./scripts/pnpm-install.sh
name: pnpm install

- run: pnpm ls
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while I'm here...


# Run tests
- run: pnpm run test-all

Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -22,6 +22,9 @@ jobs:
- script: ./scripts/pnpm-install.sh
displayName: 'pnpm install'

- script: pnpm ls
displayName: 'pnpm ls'

- script: |
if [[ $BUILD_REASON == "Schedule" ]]; then git config --global user.email "types@microsoft.com" && git config --global user.name "TypeScript Bot" && pnpm run update-codeowners; fi
git checkout -- .
Expand Down
13 changes: 12 additions & 1 deletion scripts/pnpm-install.sh
Expand Up @@ -18,7 +18,18 @@ while true; do
OLD_FILTERS=("${FILTERS[@]}")
FILTERS=()

for i in $(pnpm ls --depth Infinity --parseable "${OLD_FILTERS[@]}" | grep -v node_modules | awk NF | sort -u); do
set +e
OUTPUT=$(pnpm ls --depth Infinity --parseable "${OLD_FILTERS[@]}")
CODE=$?
set -e

if [ $CODE -ne 0 ]; then
echo "pnpm ls failed while looking for missing deps; giving up and installing everything"
echo "$OUTPUT"
exec pnpm install
fi

for i in $(echo "$OUTPUT" | grep -v node_modules | awk NF | sort -u); do
i=${i#*$PWD/}

if [ -d "$i/node_modules" ]; then
Expand Down