From b1b41b140810ab643948b65b66896b5ea9b0baca Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Tue, 25 Aug 2020 15:45:45 -0700 Subject: [PATCH 1/4] Specify SDK version in b=global.json --- global.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/global.json b/global.json index 828d1361bce60..0c8e67e80f4b4 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,9 @@ { "msbuild-sdks": { "Microsoft.Build.Traversal": "1.0.45" + }, + "sdk": { + "version": "3.1.301", + "rollForward": "disable" } } \ No newline at end of file From 6b9e23d882ddbfaa5436396897a9b5e39df41f6c Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Tue, 25 Aug 2020 15:56:31 -0700 Subject: [PATCH 2/4] Retire Dotnet Installer Task --- .../templates/jobs/archetype-sdk-client.yml | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 730a8b6e5782c..d03cdcc205064 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -30,10 +30,10 @@ jobs: RootFolder: '.' BuildSHA: $(Build.SourceVersion) RepoId: 'Azure/azure-sdk-for-net' - - task: UseDotNet@2 - displayName: "Use .NET Core sdk $(DotNetCoreSDKVersion)" - inputs: - version: "$(DotNetCoreSDKVersion)" + - pwsh: | + dotnet --list-sdks + dotnet --list-runtimes + displayName: View Dotnet Versions installed - script: >- dotnet pack eng/service.proj -o $(Build.ArtifactStagingDirectory) -warnaserror /p:ServiceDirectory=${{parameters.ServiceToBuild}} /p:PublicSign=false $(VersioningProperties) /p:Configuration=$(BuildConfiguration) /p:CommitSHA=$(Build.SourceVersion) @@ -74,15 +74,10 @@ jobs: pip install doc-warden==$(DocWardenVersion) ward scan -d $(Build.SourcesDirectory) -c $(Build.SourcesDirectory)/eng/.docsettings.yml displayName: "Verify Readmes" - - task: UseDotNet@2 - displayName: "Use .NET Core sdk $(DotNetCoreSDKVersion)" - inputs: - version: "$(DotNetCoreSDKVersion)" - - task: UseDotNet@2 - displayName: "Use .NET Core runtime $(DotNetCoreRuntimeVersion)" - inputs: - packageType: runtime - version: "$(DotNetCoreRuntimeVersion)" + - pwsh: | + dotnet --list-sdks + dotnet --list-runtimes + displayName: View Dotnet Versions installed - task: DownloadPipelineArtifact@2 displayName: "Download Build Artifacts" condition: succeededOrFailed() @@ -149,16 +144,10 @@ jobs: vmImage: "$(OSVmImage)" steps: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - - task: DotNetCoreInstaller@2 - displayName: "Use .NET Core runtime $(DotNetCoreRuntimeVersion)" - inputs: - packageType: runtime - version: "$(DotNetCoreRuntimeVersion)" - - task: DotNetCoreInstaller@2 - displayName: "Use .NET Core sdk $(DotNetCoreSDKVersion)" - inputs: - packageType: sdk - version: "$(DotNetCoreSDKVersion)" + - pwsh: | + dotnet --list-sdks + dotnet --list-runtimes + displayName: View Dotnet Versions installed - script: >- dotnet test eng/service.proj --filter TestCategory!=Live --framework $(TestTargetFramework) --logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal" /p:ServiceDirectory=${{parameters.ServiceToBuild}} /p:IncludeSrc=false /p:IncludeSamples=false /p:Configuration=$(BuildConfiguration) $(ConvertToProjectReferenceOption) /p:CollectCoverage=$(CollectCoverage) From a5c920b832013e9e965dc2a6e07d08883c16e9ab Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Tue, 25 Aug 2020 17:47:20 -0700 Subject: [PATCH 3/4] Retire UseDotNet task --- .../templates/jobs/archetype-sdk-client.yml | 12 ------------ .../templates/jobs/archetype-sdk-tests-jobs.yml | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index d03cdcc205064..2443ffa526760 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -30,10 +30,6 @@ jobs: RootFolder: '.' BuildSHA: $(Build.SourceVersion) RepoId: 'Azure/azure-sdk-for-net' - - pwsh: | - dotnet --list-sdks - dotnet --list-runtimes - displayName: View Dotnet Versions installed - script: >- dotnet pack eng/service.proj -o $(Build.ArtifactStagingDirectory) -warnaserror /p:ServiceDirectory=${{parameters.ServiceToBuild}} /p:PublicSign=false $(VersioningProperties) /p:Configuration=$(BuildConfiguration) /p:CommitSHA=$(Build.SourceVersion) @@ -74,10 +70,6 @@ jobs: pip install doc-warden==$(DocWardenVersion) ward scan -d $(Build.SourcesDirectory) -c $(Build.SourcesDirectory)/eng/.docsettings.yml displayName: "Verify Readmes" - - pwsh: | - dotnet --list-sdks - dotnet --list-runtimes - displayName: View Dotnet Versions installed - task: DownloadPipelineArtifact@2 displayName: "Download Build Artifacts" condition: succeededOrFailed() @@ -144,10 +136,6 @@ jobs: vmImage: "$(OSVmImage)" steps: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - - pwsh: | - dotnet --list-sdks - dotnet --list-runtimes - displayName: View Dotnet Versions installed - script: >- dotnet test eng/service.proj --filter TestCategory!=Live --framework $(TestTargetFramework) --logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal" /p:ServiceDirectory=${{parameters.ServiceToBuild}} /p:IncludeSrc=false /p:IncludeSamples=false /p:Configuration=$(BuildConfiguration) $(ConvertToProjectReferenceOption) /p:CollectCoverage=$(CollectCoverage) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml index 6893a124385ad..9f89d5723406e 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml @@ -55,18 +55,6 @@ jobs: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - - task: UseDotNet@2 - displayName: "Use .NET Core runtime $(DotNetCoreRuntimeVersion)" - inputs: - packageType: runtime - version: "$(DotNetCoreRuntimeVersion)" - - - task: UseDotNet@2 - displayName: "Use .NET Core sdk $(DotNetCoreSDKVersion)" - inputs: - packageType: sdk - version: "$(DotNetCoreSDKVersion)" - - template: /eng/common/TestResources/deploy-test-resources.yml parameters: Location: ${{ parameters.Location }} From de3ad4a53b61cf34600c094139d0c4fa4c0a308c Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Thu, 27 Aug 2020 10:39:07 -0700 Subject: [PATCH 4/4] Remove DownloadPipelineArtifact in analyze stage --- .../templates/jobs/archetype-sdk-client.yml | 15 +++++++++------ .../templates/jobs/archetype-sdk-tests-jobs.yml | 6 ++++++ .../templates/steps/archetype-sdk-docs.yml | 4 ---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 2443ffa526760..2646a43d73f5e 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -70,13 +70,11 @@ jobs: pip install doc-warden==$(DocWardenVersion) ward scan -d $(Build.SourcesDirectory) -c $(Build.SourcesDirectory)/eng/.docsettings.yml displayName: "Verify Readmes" - - task: DownloadPipelineArtifact@2 - displayName: "Download Build Artifacts" - condition: succeededOrFailed() + - task: UseDotNet@2 + displayName: "Use .NET Core runtime $(DotNetCoreRuntimeVersion)" inputs: - artifact: packages - path: $(Pipeline.Workspace)/packages - patterns: "*.nupkg" + packageType: runtime + version: "$(DotNetCoreRuntimeVersion)" - template: /eng/common/pipelines/templates/steps/verify-path-length.yml parameters: SourceDirectory: $(Build.SourcesDirectory) @@ -136,6 +134,11 @@ jobs: vmImage: "$(OSVmImage)" steps: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + - task: UseDotNet@2 + displayName: "Use .NET Core runtime $(DotNetCoreRuntimeVersion)" + inputs: + packageType: runtime + version: "$(DotNetCoreRuntimeVersion)" - script: >- dotnet test eng/service.proj --filter TestCategory!=Live --framework $(TestTargetFramework) --logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal" /p:ServiceDirectory=${{parameters.ServiceToBuild}} /p:IncludeSrc=false /p:IncludeSamples=false /p:Configuration=$(BuildConfiguration) $(ConvertToProjectReferenceOption) /p:CollectCoverage=$(CollectCoverage) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml index 9f89d5723406e..78101cc724d81 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml @@ -55,6 +55,12 @@ jobs: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + - task: UseDotNet@2 + displayName: "Use .NET Core runtime $(DotNetCoreRuntimeVersion)" + inputs: + packageType: runtime + version: "$(DotNetCoreRuntimeVersion)" + - template: /eng/common/TestResources/deploy-test-resources.yml parameters: Location: ${{ parameters.Location }} diff --git a/eng/pipelines/templates/steps/archetype-sdk-docs.yml b/eng/pipelines/templates/steps/archetype-sdk-docs.yml index 71e121fe1030a..b6b3e7cc990fa 100644 --- a/eng/pipelines/templates/steps/archetype-sdk-docs.yml +++ b/eng/pipelines/templates/steps/archetype-sdk-docs.yml @@ -1,8 +1,4 @@ steps: - - task: UseDotNet@2 - displayName: "Use .NET Core sdk $(DotNetCoreSDKVersion)" - inputs: - version: $(DotNetCoreSDKVersion) - pwsh: | # Download and Extract or restore Packages required for Doc Generation Write-Host "Download and Extract mdoc to Build.BinariesDirectory/mdoc"