diff --git a/src/SourceBuild/content/eng/pipelines/templates/jobs/sdk-diff-tests.yml b/src/SourceBuild/content/eng/pipelines/templates/jobs/sdk-diff-tests.yml index 96250ddcb50f..ced30310a324 100644 --- a/src/SourceBuild/content/eng/pipelines/templates/jobs/sdk-diff-tests.yml +++ b/src/SourceBuild/content/eng/pipelines/templates/jobs/sdk-diff-tests.yml @@ -106,14 +106,18 @@ jobs: eng/common/build.sh -bl --projects $(Build.SourcesDirectory)/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj --restore + source ./eng/common/tools.sh + InitializeDotNetCli true + echo "##vso[task.setvariable variable=Platform]$platform" echo "##vso[task.setvariable variable=MsftSdkTarballPath]$(Pipeline.Workspace)/Artifacts/$msft_sdk_tarball_name" echo "##vso[task.setvariable variable=SdkTarballPath]$(Pipeline.Workspace)/Artifacts/$sdk_tarball_name" + echo "##vso[task.setvariable variable=DotNetPath]$_InitializeDotNetCli" displayName: Prepare Tests workingDirectory: $(Build.SourcesDirectory) - script: > - .dotnet/dotnet test + $(DotNetPath)/dotnet test $(Build.SourcesDirectory)/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj --filter "Category=SdkContent" --logger:'trx;LogFileName=$(Agent.JobName)_SDKDiffTests.trx' @@ -169,6 +173,7 @@ jobs: - ${{ if and(eq(parameters.publishTestResultsPr, 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release'))) }}: - template: ../steps/create-baseline-update-pr.yml parameters: + dotnetPath: $(DotNetPath) pipeline: sdk repo: dotnet/installer originalFilesDirectory: src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines diff --git a/src/SourceBuild/content/eng/pipelines/templates/stages/vmr-scan.yml b/src/SourceBuild/content/eng/pipelines/templates/stages/vmr-scan.yml index 7bf3646c0169..dac4faff2a95 100644 --- a/src/SourceBuild/content/eng/pipelines/templates/stages/vmr-scan.yml +++ b/src/SourceBuild/content/eng/pipelines/templates/stages/vmr-scan.yml @@ -26,19 +26,23 @@ stages: - script: | source ./eng/common/tools.sh InitializeDotNetCli true - ./.dotnet/dotnet tool restore - displayName: Initialize tooling + echo "##vso[task.setvariable variable=DotNetPath]$_InitializeDotNetCli" + displayName: Install .NET CLI + + - script: | + $(DotNetPath)/dotnet tool restore + displayName: Restore tools workingDirectory: $(Build.SourcesDirectory)/src/installer - script: | set -e - sha=`./.dotnet/dotnet darc vmr get-version --vmr "$(Build.SourcesDirectory)" installer` + sha=`$(DotNetPath)/dotnet darc vmr get-version --vmr "$(Build.SourcesDirectory)" installer` echo "##vso[build.addbuildtag]$sha" displayName: Tag the build workingDirectory: $(Build.SourcesDirectory)/src/installer - script: > - ./.dotnet/dotnet darc vmr scan-binary-files + $(DotNetPath)/dotnet darc vmr scan-binary-files --vmr "$(Build.SourcesDirectory)" --tmp "$(Agent.TempDirectory)" --baseline-file "src/VirtualMonoRepo/allowed-binaries.txt" @@ -48,7 +52,7 @@ stages: continueOnError: true - script: > - ./.dotnet/dotnet darc vmr scan-cloaked-files + $(DotNetPath)/dotnet darc vmr scan-cloaked-files --vmr "$(Build.SourcesDirectory)" --tmp "$(Agent.TempDirectory)" || (echo '##[error]Found cloaked files in the VMR' && exit 1) diff --git a/src/SourceBuild/content/eng/pipelines/templates/steps/create-baseline-update-pr.yml b/src/SourceBuild/content/eng/pipelines/templates/steps/create-baseline-update-pr.yml index 3c53c051cefc..c73a40f0b216 100644 --- a/src/SourceBuild/content/eng/pipelines/templates/steps/create-baseline-update-pr.yml +++ b/src/SourceBuild/content/eng/pipelines/templates/steps/create-baseline-update-pr.yml @@ -1,4 +1,8 @@ parameters: +- name: dotnetPath + type: string + default: '$(Build.SourcesDirectory)/.dotnet' + # The pipeline that is being run # Used to determine the correct baseline update tool to run # Currently only supports "sdk" and "license" @@ -31,7 +35,7 @@ steps: branchName=$(echo "$(Build.SourceBranch)" | sed 's/refs\/heads\///g') - .dotnet/dotnet run \ + ${{ parameters.dotnetPath }}/dotnet run \ --project eng/tools/CreateBaselineUpdatePR/ \ --property:RestoreSources="$restoreSources" \ "${{ parameters.pipeline }}" \ diff --git a/src/SourceBuild/content/eng/pipelines/vmr-license-scan.yml b/src/SourceBuild/content/eng/pipelines/vmr-license-scan.yml index b8d583688971..e17c125138be 100644 --- a/src/SourceBuild/content/eng/pipelines/vmr-license-scan.yml +++ b/src/SourceBuild/content/eng/pipelines/vmr-license-scan.yml @@ -144,6 +144,7 @@ jobs: - script: | source ./eng/common/tools.sh InitializeDotNetCli true + echo "##vso[task.setvariable variable=DotNetPath]$_InitializeDotNetCli" displayName: Install .NET SDK workingDirectory: $(Build.SourcesDirectory) @@ -167,6 +168,7 @@ jobs: - template: templates/steps/create-baseline-update-pr.yml parameters: + dotnetPath: $(DotNetPath) pipeline: license repo: dotnet/installer originalFilesDirectory: src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/licenses