forked from sdkman/posh-gvm
-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (32 loc) · 1.24 KB
/
pester.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
name: Pester
on: [push, pull_request, workflow_dispatch]
jobs:
test-pwsh:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Run Pester tests (pwsh)
run: |
Write-host $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor
Install-Module -Name Pester -RequiredVersion 5.6.1 -Confirm:$false -Force
Set-Location -Path .\Tests\
Invoke-Pester
if ($Error[0].Fullyqualifiederrorid -eq 'PesterAssertionFailed') {exit 1}
shell: pwsh
test-posh:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Run Pester tests (PowerShell)
run: |
Write-host $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor
Install-Module -Name Pester -RequiredVersion 5.6.1 -Confirm:$false -Force
$pesterConfig = New-PesterConfiguration
$pesterConfig.CodeCoverage.Enabled = $true
Set-Location -Path .\Tests\
Invoke-Pester -Configuration $pesterConfig
if ($Error[0].Fullyqualifiederrorid -eq 'PesterAssertionFailed') {exit 1}
shell: powershell