diff --git a/eng/pipelines/jobs/test-binaries.yml b/eng/pipelines/jobs/test-binaries.yml index 92602d5f3e2..2e1a251315b 100644 --- a/eng/pipelines/jobs/test-binaries.yml +++ b/eng/pipelines/jobs/test-binaries.yml @@ -81,27 +81,52 @@ jobs: - ${{ if ne(parameters.osGroup, 'Linux_Musl')}}: # Linux builds (of all variants) run in Mariner containers and do not include pwsh by default - ${{ if eq(parameters.osGroup, 'Linux') }}: - - script: sudo -n tdnf install -y --refresh powershell + - script: | + $(Build.SourcesDirectory)/restore.sh + $(Build.SourcesDirectory)/.dotnet/dotnet tool install --global PowerShell + echo "##vso[task.prependpath]/home/cloudtest_azpcontainer/.dotnet/tools" displayName: Install pwsh - # Calculate the fully qualified Nodejs version first so that any new releases will result in a new cache key - - pwsh: eng/helix/GetNodejsVersion.ps1 - -MajorVersion $(NodeMajorVersion) - -TaskVariableName 'FqNodejsVersion' - displayName: Calculate Node.js version - - - task: Cache@2 - displayName: Node.js Cache - inputs: - # Wrap FqNodejsVersion in quotes to prevent it being interpreted as a file - key: 'nodejs | ${{ parameters.osGroup }} | ${{ parameters.architecture }} | "$(FqNodejsVersion)"' - path: $(HelixNodejsPayloadPath) - - - pwsh: eng/helix/InstallNodejs.ps1 - -Version $(FqNodejsVersion) - -Architecture ${{ parameters.architecture }} - -DestinationFolder "$(HelixNodejsPayloadPath)" - displayName: Hydrate Node.js Installation + # Calculate the fully qualified Nodejs version first so that any new releases will result in a new cache key + - script: | + pwsh ../eng/helix/GetNodejsVersion.ps1 -MajorVersion $(NodeMajorVersion) -TaskVariableName 'FqNodejsVersion' + displayName: Calculate Node.js version Linux + workingDirectory: "$(Build.SourcesDirectory)/.dotnet" + env: + DOTNET_ROOT: "$(Build.SourcesDirectory)/.dotnet" + + - task: Cache@2 + displayName: Node.js Cache Linux + inputs: + # Wrap FqNodejsVersion in quotes to prevent it being interpreted as a file + key: 'nodejs | ${{ parameters.osGroup }} | ${{ parameters.architecture }} | "$(FqNodejsVersion)"' + path: $(HelixNodejsPayloadPath) + + - script: | + pwsh ../eng/helix/InstallNodejs.ps1 -Version $(FqNodejsVersion) -Architecture ${{ parameters.architecture }} -DestinationFolder "$(HelixNodejsPayloadPath)" + displayName: Hydrate Node.js Installation Linux + workingDirectory: "$(Build.SourcesDirectory)/.dotnet" + env: + DOTNET_ROOT: "$(Build.SourcesDirectory)/.dotnet" + + - ${{ else }}: + - pwsh: eng/helix/GetNodejsVersion.ps1 + -MajorVersion $(NodeMajorVersion) + -TaskVariableName 'FqNodejsVersion' + displayName: Calculate Node.js version Non-Linux + + - task: Cache@2 + displayName: Node.js Cache Non-Linux + inputs: + # Wrap FqNodejsVersion in quotes to prevent it being interpreted as a file + key: 'nodejs | ${{ parameters.osGroup }} | ${{ parameters.architecture }} | "$(FqNodejsVersion)"' + path: $(HelixNodejsPayloadPath) + + - pwsh: eng/helix/InstallNodejs.ps1 + -Version $(FqNodejsVersion) + -Architecture ${{ parameters.architecture }} + -DestinationFolder "$(HelixNodejsPayloadPath)" + displayName: Hydrate Node.js Installation Non-Linux - ${{ else }}: - ${{ if ne(parameters.osGroup, 'Windows') }}: