| parameters: |
| jobName: "" |
| displayName: "" |
| poolName: "windows" |
| imageName: 'none' |
|
|
| jobs: |
| - job: ${{ parameters.jobName }} |
| displayName: ${{ parameters.displayName }} |
| pool: |
| type: linux |
| isCustom: true |
| ${{ if eq( parameters.poolName, 'Azure Pipelines') }}: |
| name: ${{ parameters.poolName }} |
| vmImage: ${{ parameters.imageName }} |
| ${{ else }}: |
| name: ${{ parameters.poolName }} |
| demands: |
| - ImageOverride -equals ${{ parameters.imageName }} |
|
|
| variables: |
| - group: mscodehub-feed-read-general |
| - group: mscodehub-feed-read-akv |
| - group: DotNetPrivateBuildAccess |
|
|
| steps: |
| - checkout: self |
| clean: true |
| lfs: false |
|
|
| - template: /.pipelines/templates/insert-nuget-config-azfeed.yml@self |
| parameters: |
| repoRoot: "$(Build.SourcesDirectory)" |
|
|
| - template: release-SetReleaseTagandContainerName.yml@self |
|
|
| - download: PSPackagesOfficial |
| artifact: drop_nupkg_build_nupkg |
| displayName: Download nupkgs |
|
|
| - pwsh: | |
| Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose |
| displayName: Capture environment |
|
|
| - pwsh: | |
| Get-ChildItem "$(Pipeline.Workspace)/PSPackagesOfficial/drop_nupkg_build_nupkg" -Recurse |
| displayName: 'Capture Downloaded Artifacts' |
|
|
| - template: /.pipelines/templates/install-dotnet.yml@self |
|
|
| - pwsh: | |
| $repoRoot = "$(Build.SourcesDirectory)" |
| |
| Import-Module "$repoRoot/build.psm1" -Force -Verbose |
| Start-PSBootstrap -Scenario Dotnet |
|
|
| $env:DOTNET_NOLOGO=1 |
|
|
| $localLocation = "$(Pipeline.Workspace)/PSPackagesOfficial/drop_nupkg_build_nupkg" |
| $xmlElement = @" |
| <add key=`"local`" value=`"$localLocation`" /> |
| <add key="dotnet" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v2" /> |
| </packageSources> |
| "@ |
| |
| $releaseVersion = '$(OutputVersion.Version)' |
| |
| Write-Verbose -Message "Release Version: $releaseVersion" -Verbose |
|
|
| Set-Location -Path $repoRoot/test/hosting |
|
|
| Get-ChildItem |
|
|
| |
| $nugetPath = './NuGet.Config' |
| if(!(test-path $nugetPath)) { |
| $nugetPath = "$repoRoot/nuget.config" |
| } |
| Write-Verbose -Verbose "nugetPath: $nugetPath" |
| $nugetConfigContent = Get-Content $nugetPath -Raw |
| $updateNugetContent = $nugetConfigContent.Replace("</packageSources>", $xmlElement) |
|
|
| $updateNugetContent | Out-File $nugetPath -Encoding ascii |
|
|
| Get-Content $nugetPath |
|
|
| dotnet --info |
| dotnet restore |
| dotnet test /property:RELEASE_VERSION=$releaseVersion --test-adapter-path:. "--logger:xunit;LogFilePath=$(System.DefaultWorkingDirectory)/test-hosting.xml" |
| displayName: Restore and execute tests |
| env: |
| __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) |
|
|
| - task: PublishTestResults@2 |
| displayName: 'Publish Test Results **\test-hosting.xml' |
| inputs: |
| testResultsFormat: XUnit |
| testResultsFiles: '**\test-hosting.xml' |
|
|