-
Notifications
You must be signed in to change notification settings - Fork 49
/
appveyor.yml
52 lines (44 loc) · 2.36 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
# Set to FALSE because it is not a .NET project
build: false
version: 1.4.{build}
os: WMF 5
branches:
only:
- master
environment:
# Encrypted PowerShellGallery API Key to facilitate publishing
# See https://ci.appveyor.com/tools/encrypt
POWERSHELLGALLERY_APIKEY:
secure: N0QcDfMjLFNLLPDqHdn/3YClqVccTn4taJOER39vcXO1mBlSyiNJ/vsYqX+QNgbr
skip_commits:
# Skip on updates to the readme. [skip ci] or [ci skip] anywhere in commit message will also prevent a ci build
message: /update readme.*/
install:
# Force bootstrap of the Nuget PackageManagement Provider; Reference: http://www.powershellgallery.com/GettingStarted?section=Get%20Started
- ps: Get-PackageProvider -Name NuGet -Force
# Install pester PowerShell Unit Testing module
- cinst -y pester
before_test:
# Set FunctionsToExport and ModuleVersion in the module manifest (F5-LTM.psd1); Fixes #37 Do not export Private\*.ps1 functions
- ps: |
$FunctionsToExport = ((Get-ChildItem (Join-Path $env:APPVEYOR_BUILD_FOLDER 'F5-LTM\Public') -Filter '*.ps1' -Recurse).BaseName) -join "','"
(Get-Content (Join-Path $env:APPVEYOR_BUILD_FOLDER 'F5-LTM\F5-LTM.psd1') -Raw) -replace
"FunctionsToExport = '.*'","FunctionsToExport = '$FunctionsToExport'" -replace
"ModuleVersion = '.*'", "ModuleVersion = '$env:APPVEYOR_BUILD_VERSION'" |
Set-Content (Join-Path $env:APPVEYOR_BUILD_FOLDER 'F5-LTM\F5-LTM.psd1')
test_script:
# Install PSScriptAnalyzer module for enforcing best practices
- ps: Install-Module -Name PSScriptAnalyzer -Force
# Invoke PSScriptAnalyzer against the module to make sure it's not failing any tests
- ps: Invoke-ScriptAnalyzer -Path (Join-Path $env:APPVEYOR_BUILD_FOLDER 'F5-LTM') -Recurse
# Invoke-Pester unit tests
- ps: $testResultsFile = '.\TestsResults.xml'
# run tests
- ps: $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
# upload results to AppVeyor
- ps: (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
# if failures, quit to prevent publish
- ps: if ($res.FailedCount -gt 0) { "$($res.FailedCount) tests failed." }
deploy_script:
# Publish module to the PowerShellGallery
- ps: Publish-Module -NugetApiKey $env:POWERSHELLGALLERY_APIKEY -Path (Join-Path $env:APPVEYOR_BUILD_FOLDER 'F5-LTM')