-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
31 lines (27 loc) · 1.38 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
image: Visual Studio 2017
install:
- ps: Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
build_script:
- ps: |
$PSVersionTable
dotnet --version
test_script:
- ps: |
# Pester
Get-Module Pester -ListAvailable # Show Pester version (should be 3.4)
$testResultsFile = ".\TestsResults.xml"
$results = Invoke-Pester -Path . -OutputFormat NUnitXml -OutputFile $testResultsFile -CodeCoverage @(
(Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath '*.psm1')
) -PassThru -Verbose
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
# Convert and upload code coverage
$codeCoverage = $results.CodeCoverage.NumberOfCommandsExecuted /( $results.CodeCoverage.NumberOfCommandsExecuted + $results.CodeCoverage.NumberOfCommandsMissed)
Save-Module -Name VSTS -Path . -RequiredVersion 1.0.189
Import-Module .\VSTS\1.0.189\ci\CodeCovIo.psd1
Export-CodeCovIoJson -CodeCoverage $results.CodeCoverage -RepoRoot $env:APPVEYOR_BUILD_FOLDER -Path 'codeCov.json'
if ($results.FailedCount -gt 0)
{
throw "$($results.FailedCount) tests failed."
}
- choco install codecov
- codecov -f "codeCov.json" -t "a432d38a-1b82-4a4d-8bfd-cd81b2ef6a3f"