2019-04-02 01:58:43 +02:00
|
|
|
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
|
|
|
|
trigger:
|
|
|
|
# Batch merge builds together while a merge build is running
|
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
- release*
|
2019-05-16 19:30:50 +02:00
|
|
|
- feature*
|
2019-04-02 01:58:43 +02:00
|
|
|
paths:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
exclude:
|
|
|
|
- /.vsts-ci/misc-analysis.yml
|
|
|
|
- /.github/ISSUE_TEMPLATE/*
|
2019-05-16 19:30:50 +02:00
|
|
|
- /.dependabot/config.yml
|
2019-04-02 01:58:43 +02:00
|
|
|
pr:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
- release*
|
2019-05-16 19:30:50 +02:00
|
|
|
- feature*
|
2019-04-02 01:58:43 +02:00
|
|
|
paths:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
exclude:
|
|
|
|
- /.vsts-ci/misc-analysis.yml
|
|
|
|
- /.github/ISSUE_TEMPLATE/*
|
2019-05-16 19:30:50 +02:00
|
|
|
- /.dependabot/config.yml
|
2019-04-02 01:58:43 +02:00
|
|
|
|
|
|
|
variables:
|
|
|
|
GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'"
|
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
|
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
|
|
# Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
|
|
|
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
2019-10-24 21:45:26 +02:00
|
|
|
__SuppressAnsiEscapeSequences: 1
|
2019-04-02 01:58:43 +02:00
|
|
|
|
|
|
|
resources:
|
|
|
|
- repo: self
|
|
|
|
clean: true
|
|
|
|
|
2019-05-16 19:30:50 +02:00
|
|
|
stages:
|
|
|
|
- stage: BuildWin
|
|
|
|
displayName: Build for Windows
|
|
|
|
jobs:
|
|
|
|
- template: templates/ci-build.yml
|
2019-04-02 01:58:43 +02:00
|
|
|
|
2019-05-16 19:30:50 +02:00
|
|
|
- stage: TestWin
|
|
|
|
displayName: Test for Windows
|
2020-06-08 21:07:10 +02:00
|
|
|
variables:
|
|
|
|
- group: CLR-CAP
|
2019-05-16 19:30:50 +02:00
|
|
|
jobs:
|
2020-05-29 19:01:29 +02:00
|
|
|
- job: win_test
|
|
|
|
pool:
|
|
|
|
vmImage: vs2017-win2016
|
|
|
|
displayName: Windows Test
|
2019-04-02 01:58:43 +02:00
|
|
|
|
2020-05-29 19:01:29 +02:00
|
|
|
steps:
|
2020-06-02 20:33:27 +02:00
|
|
|
- pwsh: |
|
|
|
|
Get-ChildItem -Path env:
|
|
|
|
displayName: 'Capture Environment'
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download Build Artifacts'
|
|
|
|
inputs:
|
|
|
|
downloadType: specific
|
|
|
|
itemPattern: |
|
|
|
|
build/**/*
|
|
|
|
xunit/**/*
|
|
|
|
downloadPath: '$(System.ArtifactsDirectory)'
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse
|
|
|
|
displayName: 'Capture Artifacts Directory'
|
|
|
|
continueOnError: true
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
$capRootDir = Join-Path ([System.IO.Path]::GetTempPath()) "CAP"
|
|
|
|
$capUtilDir = Join-Path $capRootDir "Utils"
|
|
|
|
|
|
|
|
if (Test-Path $capRootDir) { Remove-Item $capRootDir -Recurse -Force }
|
|
|
|
New-Item $capUtilDir -ItemType Directory > $null
|
|
|
|
|
|
|
|
$capZipFile = Join-Path $capRootDir "cap.zip"
|
|
|
|
Invoke-WebRequest -Uri https://pscoretestdata.blob.core.windows.net/dotnet-cap/windows.zip -OutFile $capZipFile
|
|
|
|
Unblock-File -Path $capZipFile
|
|
|
|
Expand-Archive -Path $capZipFile -DestinationPath $capUtilDir -Force
|
|
|
|
|
|
|
|
Write-Host "=== Capture CAP Util Directory ==="
|
|
|
|
Get-ChildItem $capUtilDir -Recurse
|
|
|
|
|
|
|
|
Write-Host "##vso[task.setvariable variable=CapRootDir]$capRootDir"
|
|
|
|
Write-Host "##vso[task.setvariable variable=CapUtilDir]$capUtilDir"
|
|
|
|
displayName: 'Download CAP package'
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
|
|
|
# must be run frow Windows PowerShell
|
|
|
|
- powershell: |
|
|
|
|
Import-Module .\tools\ci.psm1
|
|
|
|
Invoke-CIInstall
|
|
|
|
displayName: Bootstrap
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Import-Module .\build.psm1
|
|
|
|
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
|
|
|
|
$path = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions))
|
|
|
|
$rootPath = Split-Path -Path $path
|
|
|
|
Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force
|
|
|
|
displayName: 'Unzip Build'
|
|
|
|
condition: succeeded()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Import-Module $(CapUtilDir)\CAPService.psm1
|
|
|
|
$dataDir = Start-TraceCollection -RootDir $(CapRootDir)
|
|
|
|
Write-Host "##vso[task.setvariable variable=CapDataDir]$dataDir"
|
|
|
|
displayName: 'Start CLR Trace Collection'
|
|
|
|
condition: succeeded()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Import-Module .\tools\ci.psm1
|
|
|
|
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
|
|
|
|
Invoke-CITest -Purpose UnelevatedPesterTests -TagSet CI
|
|
|
|
displayName: Test - UnelevatedPesterTests - CI
|
|
|
|
condition: succeeded()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Import-Module .\tools\ci.psm1
|
|
|
|
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
|
|
|
|
Invoke-CITest -Purpose ElevatedPesterTests -TagSet CI
|
|
|
|
displayName: Test - ElevatedPesterTests - CI
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Import-Module .\tools\ci.psm1
|
|
|
|
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
|
|
|
|
Invoke-CITest -Purpose UnelevatedPesterTests -TagSet Others
|
|
|
|
displayName: Test - UnelevatedPesterTests - Others
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Import-Module .\tools\ci.psm1
|
|
|
|
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
|
|
|
|
Invoke-CITest -Purpose ElevatedPesterTests -TagSet Others
|
|
|
|
displayName: Test - ElevatedPesterTests - Others
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
Import-Module .\build.psm1
|
2020-06-08 21:07:10 +02:00
|
|
|
$xUnitTestResultsFile = '$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml'
|
2020-06-02 20:33:27 +02:00
|
|
|
Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile
|
|
|
|
displayName: Verify xUnit Test Results
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
$capDataDir = '$(CapDataDir)'
|
|
|
|
$capModuleFile = '$(CapUtilDir)\CAPService.psm1'
|
|
|
|
|
|
|
|
if ((Test-Path $capModuleFile) -and (Test-Path $capDataDir)) {
|
|
|
|
Import-Module $capModuleFile
|
2020-06-08 21:07:10 +02:00
|
|
|
Stop-TraceCollection -DataDir $capDataDir -RepoRoot $pwd -IngressToken '$(CapIngressToken)'
|
2020-06-02 20:33:27 +02:00
|
|
|
}
|
|
|
|
displayName: 'Upload CLR Trace'
|
|
|
|
condition: always()
|
2019-05-16 19:30:50 +02:00
|
|
|
|
|
|
|
- stage: PackagingWin
|
|
|
|
displayName: Packaging for Windows
|
|
|
|
jobs:
|
|
|
|
# Unlike daily builds, we do not upload nuget package to MyGet so we do not wait on tests to finish.
|
|
|
|
- template: templates/windows-packaging.yml
|