-
-
Notifications
You must be signed in to change notification settings - Fork 145
32 lines (26 loc) · 1.15 KB
/
PR-PesterTest.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
name: PR-Pester
on:
pull_request:
branches:
- development
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code Install and run Pester annoyingly on Windows PowerShell https://github.com/pester/Pester/issues/1295
uses: actions/[email protected]
- run: |
pwd
$manifest = Import-PowershellDataFile -Path .\dbachecks.psd1
$PSFrameworkVersion = $manifest.RequiredModules.Where{$_.ModuleName -eq 'PSFramework'}.ModuleVersion
$dbatoolsVersion = $manifest.RequiredModules.Where{$_.ModuleName -eq 'dbatools'}.ModuleVersion
Install-Module Pester -RequiredVersion 4.10.0 -Force
Install-Module dbatools -RequiredVersion $dbatoolsVersion -Force
Install-Module PSFramework -RequiredVersion $PsFrameworkVersion -Force
Import-Module .\dbachecks.psd1 -Verbose
$PesterResults = Invoke-Pester .\tests -ExcludeTag Integration -Show Fails -PassThru
If($PesterResults.FailedCount -ne 0){
Write-Warning "Some Tests Failed - See results above"
[System.Environment]::Exit(1)
}
shell: powershell