Skip to content

Commit 306d322

Browse files
authored
Update test-powershell.yml
1 parent 6d52e19 commit 306d322

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed
Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,41 @@
11
name: PowerShell Testing
2-
on: [push, pull_request]
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
39
jobs:
410
test:
511
runs-on: windows-latest
12+
613
steps:
7-
- uses: actions/checkout@v3
8-
- name: Test PowerShell Script
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup PowerShell
18+
shell: pwsh
919
run: |
10-
Invoke-Pester Tests/ -OutputFormat NUnitXml
20+
Set-PSRepository PSGallery -InstallationPolicy Trusted
21+
Install-Module -Name Pester -Force -SkipPublisherCheck
22+
23+
- name: Run Pester Tests
24+
shell: pwsh
25+
run: |
26+
Invoke-Pester -Path "Tests/" -OutputFormat NUnitXml -OutputFile "TestResults.xml" -CI
27+
28+
- name: Publish Test Results
29+
uses: dorny/test-reporter@v1
30+
if: always()
31+
with:
32+
name: PowerShell Tests
33+
path: TestResults.xml
34+
reporter: java-junit
35+
36+
- name: Upload Test Results
37+
uses: actions/upload-artifact@v3
38+
if: always()
39+
with:
40+
name: test-results
41+
path: TestResults.xml

0 commit comments

Comments
 (0)