Skip to content

Commit 369b3fa

Browse files
author
Mathieu Buisson
committed
Added appveyor.yml and Appveyor badge to GitHub
1 parent a426811 commit 369b3fa

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# PowerShell-DevOps
22
PowerShell scripts or modules for purposes related to DevOps practices
3+
4+
[![Build status](https://ci.appveyor.com/api/projects/status/b9c8pi933yir8ex6/branch/master?svg=true)](https://ci.appveyor.com/project/MathieuBuisson/powershell-devops/branch/master)

appveyor.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 1.0.{build}
2+
3+
os: WMF 5
4+
5+
# Skip on updates to the readme
6+
skip_commits:
7+
message: /readme*/
8+
9+
install:
10+
- ps: Install-PackageProvider -Name NuGet -Force
11+
- ps: Install-Module -Name Pester -Force
12+
- ps: Install-Module PsScriptAnalyzer -Force
13+
14+
build: false
15+
16+
test_script:
17+
- ps: |
18+
Add-AppveyorTest -Name "Pester" -Outcome Running
19+
$ScriptAnalyzerRulesTests = Invoke-Pester -Script ".\CustomPSScriptAnalyzerRules\Tests" -PassThru
20+
$FailedCount = $ScriptAnalyzerRulesTests.FailedCount
21+
If ($FailedCount -gt 0) {
22+
Add-AppveyorMessage -Message "$FailedCount.ToString() Pester tests failed.`
23+
Check the console ouput for details." -Category Error
24+
Update-AppveyorTest -Name "Pester" -Outcome Failed -ErrorMessage "$FailedCount.ToString() Pester tests failed."
25+
26+
# Failing the build
27+
Throw "Build failed because the Pester tests failed"
28+
}
29+
Else {
30+
Update-AppveyorTest -Name "Pester" -Outcome Passed
31+
}

0 commit comments

Comments
 (0)