Skip to content

Commit 4775d61

Browse files
committed
Fix Pester tests
1 parent 2a53423 commit 4775d61

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/Pester.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,31 @@ jobs:
3131
- name: Checkout code
3232
uses: actions/checkout@v4
3333

34-
- name: Install required modules
35-
shell: ${{ matrix.psversion }}
34+
- name: Install required modules (PowerShell 7.x)
35+
if: matrix.psversion == 'pwsh'
36+
shell: pwsh
37+
run: |
38+
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
39+
Install-Module -Name Pester -MinimumVersion 5.0.0 -Force -SkipPublisherCheck
40+
Install-Module -Name PScribo -MinimumVersion 0.11.1 -Force
41+
42+
- name: Install required modules (PowerShell 5.1)
43+
if: matrix.psversion == 'powershell'
44+
shell: powershell
3645
run: |
3746
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
3847
Install-Module -Name Pester -MinimumVersion 5.0.0 -Force -SkipPublisherCheck
3948
Install-Module -Name PScribo -MinimumVersion 0.11.1 -Force
4049
41-
- name: Run Pester tests
42-
shell: ${{ matrix.psversion }}
50+
- name: Run Pester tests (PowerShell 7.x)
51+
if: matrix.psversion == 'pwsh'
52+
shell: pwsh
53+
run: |
54+
.\Tests\Invoke-Tests.ps1 -CodeCoverage -OutputFormat NUnitXml
55+
56+
- name: Run Pester tests (PowerShell 5.1)
57+
if: matrix.psversion == 'powershell'
58+
shell: powershell
4359
run: |
4460
.\Tests\Invoke-Tests.ps1 -CodeCoverage -OutputFormat NUnitXml
4561

0 commit comments

Comments
 (0)