forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use different Node versions for build and test (Azure#8804)
- Update pnpm to latest (known to fail on Node 8) - Reinstall packages with native dependencies after swapping node version - Delete Rush install folder after swapping node versions - Workaround for microsoft/rushstack#1878
- Loading branch information
1 parent
4997350
commit f323b68
Showing
6 changed files
with
58 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(NodeTestVersion) | ||
displayName: "Use NodeJS $(NodeTestVersion)" | ||
|
||
- script: | | ||
node --version && npm --version | ||
displayName: Node versions | ||
# Packages with native dependencies must be reinstalled after changing Node versions | ||
- pwsh: | | ||
$KeytarSymlinkPath = "common/temp/node_modules/.pnpm/node_modules/keytar" | ||
# Map from the symlink path to the target path (npm has issues installing into symlink dirs) | ||
# Example: common/temp/node_modules/.pnpm/registry.npmjs.org/keytar/5.4.0/node_modules/keytar | ||
$KeytarTargetPath = (Get-Item $KeytarSymlinkPath).Target | ||
# Need to run "npm install" at path containing "node_modules" folder | ||
# Example: common/temp/node_modules/.pnpm/registry.npmjs.org/keytar/5.4.0 | ||
$KeytarInstallPath = Join-Path $KeytarTargetPath "../.." | ||
# The version is the leaf node of the path | ||
# Example: 5.4.0 | ||
$KeytarVersion = Split-Path -Leaf $KeytarInstallPath | ||
Set-Location $KeytarInstallPath | ||
# Install matching version of package | ||
npm install --no-package-lock keytar@$KeytarVersion | ||
displayName: Reinstall native dependencies | ||
# After changing Node versions, Rush will attempt to reinstall itself, but will be blocked on | ||
# Windows due to issue microsoft/rushstack#1878. A workaround is to manually delete the Rush | ||
# install folder. | ||
- pwsh: Remove-Item -Recurse -Force common/temp/install-run | ||
displayName: Delete Rush install folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters