diff --git a/.azure/pipelines/templates/build.yaml b/.azure/pipelines/templates/build.yaml index 9c81f9b2793..3af15de3b6a 100644 --- a/.azure/pipelines/templates/build.yaml +++ b/.azure/pipelines/templates/build.yaml @@ -51,7 +51,6 @@ parameters: displayName: Run CodeQL3000 tasks type: boolean - jobs: # Approval needed for publishing to nuget.org @@ -177,6 +176,9 @@ jobs: targetPath: '$(Build.ArtifactStagingDirectory)/test_outputs_${{category}}_${{framework}}_$(Build.BuildId)' artifactName: 'test_outputs_${{category}}_${{framework}}_$(System.JobAttempt)' condition: succeededOrFailed() + variables: + # Transform "net8.0" to "8.0.x" for the second DotNetCoreCLI@2 + testFrameworkToInstall: ${{format('{0}.x', replace(upper(framework), 'NET', ''))}} steps: - checkout: self - task: UseDotNet@2 @@ -207,6 +209,11 @@ jobs: # AzurePipelinesCredential expect the GUID of the connection, not the name, so let's get it here Write-Host "##vso[task.setvariable variable=serviceConnectionId]$($env:SERVICE_CONNECTION_ID)" Get-ChildItem env: + - task: UseDotNet@2 + # We need this step because the tested framework can be different from the build framework + inputs: + version: ${{variables.testFrameworkToInstall}} + displayName: 'Install .NET Core sdk used in tests' - task: DotNetCoreCLI@2 displayName: Test env: