-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathappveyor.yml
32 lines (27 loc) · 1.59 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
image: Visual Studio 2017
install:
- ps: $PSVersionTable
- ps: Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
build_script:
- ps: Import-Module .\posh-vsts-cli.psd1 # needed because otherwise AppVeyor complains
test_script:
- ps: |
# Pester
Get-Module Pester -ListAvailable # Show Pester version (should be 3.4)
$testResultsFile = ".\TestsResults.xml"
Import-Module .\posh-vsts-cli.psd1;
$results = Invoke-Pester -Script @( @{Path='.\install-vstscli.tests.ps1'}, @{Path='.\posh-vsts.tests.ps1'} , @{Path='.\vsts-cli-tabcompletion.tests.ps1'} ) -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 "032d095a-db58-4d89-80db-c24182c5bcad"