Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/pester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
run: |
$config = New-PesterConfiguration
$config.Run.Path = './tests'
$config.Run.Exit = $true
$config.Output.Verbosity = 'Detailed'
$config.TestResult.Enabled = $true
$config.TestResult.OutputPath = 'testResults-pwsh.xml'
Expand All @@ -66,15 +67,21 @@ jobs:
if-no-files-found: warn

windows-powershell:
name: Pester (Windows PowerShell 5.1)
strategy:
fail-fast: false
matrix:
shell: [powershell, pwsh]
name: Pester (Windows ${{ matrix.shell }})
defaults:
run:
shell: ${{ matrix.shell }}
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Validate PowerShell parser
shell: powershell
run: |
$errors = $null
$null = [System.Management.Automation.Language.Parser]::ParseFile(
Expand All @@ -86,7 +93,6 @@ jobs:
}

- name: Ensure Pester 5 is available
shell: powershell
run: |
$pester = Get-Module -ListAvailable -Name Pester |
Where-Object { $_.Version.Major -ge 5 } |
Expand All @@ -97,20 +103,20 @@ jobs:
}

- name: Run Pester tests
shell: powershell
run: |
$config = New-PesterConfiguration
$config.Run.Path = './tests'
$config.Run.Exit = $true
$config.Output.Verbosity = 'Detailed'
$config.TestResult.Enabled = $true
$config.TestResult.OutputPath = 'testResults-windows-powershell.xml'
$config.TestResult.OutputPath = 'testResults-windows-${{ matrix.shell }}.xml'
$config.TestResult.OutputFormat = 'NUnitXml'
Invoke-Pester -Configuration $config

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: pester-results-windows-powershell
path: testResults-windows-powershell.xml
name: pester-results-windows-${{ matrix.shell }}
path: testResults-windows-${{ matrix.shell }}.xml
if-no-files-found: warn
Loading
Loading