forked from MicrosoftDocs/PowerShell-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-steps.yml
42 lines (36 loc) · 1.64 KB
/
ci-steps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
steps:
- powershell: |
Get-ChildItem Env:\
displayName: Capture environment
#- powershell: |
# if ((Get-Command pwsh -CommandType Application -ErrorAction Ignore) -eq $null)
# {
# Write-Verbose -Verbose "Installing pwsh"
# $destPath = "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}/install-powershell.ps1"
# Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1' -OutFile $destPath
# Unblock-File $destPath
# & $destPath -UseMSI -Quiet
# }
# displayName: Install pwsh if not available
- powershell: |
Install-Module -Name platyPS -Repository PSGallery -Force
displayName: Install tools
- powershell: |
$(Build.SourcesDirectory)\build.ps1
displayName: Build
- powershell: |
Compress-Archive -Path "$(Build.SourcesDirectory)\updatablehelp\*" -DestinationPath "$(Build.ArtifactStagingDirectory)\updatablehelp-$(Build.BuildId).zip"
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$(Build.ArtifactStagingDirectory)\updatablehelp-$(Build.BuildId).zip"
displayName: Compress and upload updatable help content
# We run tests on Windows PowerShell. Changing to PowerShell core would need changes to the tests
- powershell: |
Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck
Import-Module "$(Build.SourcesDirectory)/tests/PowerShellDocsTests.psm1" -Force
Invoke-Test
displayName: Test
# Publish Test Results to Azure Pipelines/TFS
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResults.xml'
searchFolder: '$(Build.SourcesDirectory)'