Skip to content
Open
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
59 changes: 59 additions & 0 deletions .github/workflows/win-linux-mac-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Run Pester Tests

on:
pull_request:
branches:
- main
- release/**
push:
branches:
- main
- release/**

jobs:
test:
name: Run Pester Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'

- name: Install Pester
shell: pwsh
run: |
Write-Verbose -Verbose "Installing Pester 4.x"
Install-Module -Name Pester -MaximumVersion 4.99 -Force -Scope CurrentUser -SkipPublisherCheck
Import-Module Pester -MaximumVersion 4.99 -Force

- name: Build Module
shell: pwsh
run: |
./build.ps1 -Build -Clean -BuildConfiguration Release

- name: Run Pester Tests
shell: pwsh
run: |
Invoke-Pester -Path './test' -OutputFile 'testResults.xml' -OutputFormat NUnitXml -EnableExit

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: testResults.xml

- name: Publish Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: testResults.xml
3 changes: 1 addition & 2 deletions test/Microsoft.PowerShell.ThreadJob.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ Describe 'Job2 class API tests' -Tags 'CI' {
It 'Verifies terminating job error' {

$job = Start-ThreadJob -ScriptBlock { throw "My Job Error!" } | Wait-Job
$results = $job | Receive-Job 2>&1
$results.ToString() | Should -Be "My Job Error!"
$job.JobStateInfo.Reason.Message | Should -Be "My Job Error!"
}
}
Loading