-
Notifications
You must be signed in to change notification settings - Fork 154
/
appveyor.yml
67 lines (60 loc) · 2.37 KB
/
appveyor.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: 0.11.0.{build}
branches:
except:
- v2
install:
- ps: |
Write-Host "PowerShell Version:" $PSVersionTable.PSVersion.tostring()
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name Pester -RequiredVersion 4.10.1 -Force
init:
- git config --global core.autocrlf true
build_script:
- ps: |
$ErrorActionPreference = 'Stop'
Update-Help Microsoft.PowerShell.Core, Microsoft.PowerShell.Management, Microsoft.PowerShell.Utility -Force # we need up-to-date help content for tests
.\build.ps1 -Configuration Release
test_script:
- dotnet test .\test\Markdown.MAML.Test
after_test:
- ps: |
# We run Pester tests in after_test step
# we don't want to use test_script
# appveyor doesn't run after_test, if tests failed.
#
# Pester tests produce artifacts in .\out directory
$pesterTestResultsFile = ".\TestsResults.xml"
$res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $pesterTestResultsFile -PassThru
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $pesterTestResultsFile))
# Trying to fail the build, if there are problems
$errorString = ''
# All tests should pass
if ($res.FailedCount -gt 0) {
$errorString += "$($res.FailedCount) tests failed.`n"
}
# Documentation itself should be up-to-date
Update-MarkdownHelp -Path ./docs
$diff = git diff
if ($diff) {
$errorString += "Help is not up-to-date, run Update-MarkdownHelp: $diff`n"
}
if ($errorString) {
throw $errorString
}
on_finish:
- ps: |
$ErrorActionPreference = 'Stop'
try {
$stagingDirectory = (Resolve-Path ..).Path
$zipFile = Join-Path $stagingDirectory "platyPS-$($env:APPVEYOR_BUILD_VERSION).zip"
Add-Type -assemblyname System.IO.Compression.FileSystem
7z a -tzip $zipFile "$pwd\out\platyPS"
@(
# You can add other artifacts here
(ls $zipFile),
(ls .\out -File)
# flattering
) | % {$_} | ? {$_} |% { Push-AppveyorArtifact $_.FullName }
} catch {
Write-Host -Foreground Red $_
}