-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAppveyor.yml
33 lines (26 loc) · 1.12 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
version: 1.0.{build}
environment:
PSgalleryKey:
secure: wl8DNkBd6QUSBAEWxCNTTW+cVn32ub6kWSqZxAUrpx4/QPnWYGiLWEj+ZaFp5cuA
install:
- ps: >-
Install-PackageProvider -Name NuGet -Force
Install-Module -Name PSScriptAnalyzer -Force
Install-Module -Name -verbose Pester -Force
build: off
test_script:
- ps: >-
import-module pester
start-sleep -seconds 2
Get-Module Pester
Get-Module RegardsCitoyenPS
write-verbose "invoking pester"
$res = Invoke-Pester -Path ".\Tests" -OutputFormat NUnitXml -OutputFile TestsResults.xml -PassThru
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestsResults.xml))
if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed."}
if($res.FailedCount -eq 0 -and $APPVEYOR_REPO_COMMIT_MESSAGE -match '^.*dep-psgallery$'){
publish-module -Name RegardsCitoyenPS -NuGetApiKey $PSgalleryKey
write-host "Module deployed to the psgallery" -forgroundcolor green
}else{
write-host "Module not deployed to the psgallery" -forgroundcolor Yellow
}