Skip to content

Commit 33b1b91

Browse files
ericchansenCopilot
andcommitted
ci: add GitHub Actions workflow for Pester tests
Runs on ubuntu, windows, and macos with PowerShell 7. Uploads NUnit XML test results as artifacts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e2bfe01 commit 33b1b91

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Pester Tests — ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Pester
22+
shell: pwsh
23+
run: Install-Module Pester -Force -SkipPublisherCheck -Scope CurrentUser -MinimumVersion 5.0
24+
25+
- name: Run tests
26+
shell: pwsh
27+
run: |
28+
Import-Module Pester -MinimumVersion 5.0
29+
$cfg = New-PesterConfiguration
30+
$cfg.Run.Path = './tests'
31+
$cfg.Output.Verbosity = 'Detailed'
32+
$cfg.TestResult.Enabled = $true
33+
$cfg.TestResult.OutputFormat = 'NUnitXml'
34+
$cfg.TestResult.OutputPath = './test-results.xml'
35+
Invoke-Pester -Configuration $cfg
36+
37+
- name: Upload test results
38+
if: always()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: test-results-${{ matrix.os }}
42+
path: test-results.xml

0 commit comments

Comments
 (0)