PowerShell/.vsts-ci/windows.yml

100 lines
2.9 KiB
YAML
Raw Normal View History

name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
trigger:
branches:
include:
- master
- release*
paths:
include:
- '*'
exclude:
- /tools/releaseBuild/**/*
- /.vsts-ci/spelling.yml
pr:
branches:
include:
- master
- release*
paths:
include:
- '*'
exclude:
- /tools/releaseBuild/**/*
- /.vsts-ci/spelling.yml
queue:
name: Hosted VS2017
parallel: 2 # Limit to two agents at a time
matrix:
UnelevatedPesterTests:
Purpose: UnelevatedPesterTests
ElevatedPesterTests_xUnit_Packaging:
Purpose: ElevatedPesterTests_xUnit_Packaging
timeoutInMinutes: 120
variables:
GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'"
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
# Avoid expensive initialization of dotnet cli, see: http://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
resources:
- repo: self
clean: true
steps:
- powershell: |
Get-ChildItem -Path env:
displayName: Capture environment
condition: succeededOrFailed()
- powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
displayName: Set Build Name for Non-PR
condition: ne(variables['Build.Reason'], 'PullRequest')
- powershell: |
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules
if(-not (Test-Path "$(Build.SourcesDirectory)/src/Modules/nuget.config"))
{
throw "nuget.config is not created"
}
displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules '
condition: and(succeededOrFailed(), ne(variables['AzDevOpsFeed'], ''))
- powershell: |
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Import-Module .\tools\Appveyor.psm1
Invoke-AppveyorInstall
displayName: Bootstrap
condition: succeededOrFailed()
- powershell: |
Import-Module .\tools\Appveyor.psm1
Invoke-AppveyorBuild
Save-PSOptions
displayName: Build
condition: succeeded()
- powershell: |
Import-Module .\tools\Appveyor.psm1
Restore-PSOptions
Invoke-AppveyorTest -Purpose '$(Purpose)'
displayName: Test
condition: succeeded()
- powershell: |
Import-Module .\tools\Appveyor.psm1
Restore-PSOptions
Invoke-AppveyorAfterTest
displayName: AfterTest
condition: succeededOrFailed()
- powershell: |
Import-Module .\tools\Appveyor.psm1
Restore-PSOptions
2018-12-14 02:23:41 +01:00
Invoke-AppveyorFinish -NuGetKey $(NUGET_KEY)
displayName: Finish
condition: eq(variables['Purpose'], 'ElevatedPesterTests_xUnit_Packaging')