@@ -107,8 +107,8 @@ jobs:
107107 shell : pwsh
108108 run : Invoke-ScriptAnalyzer -Path . -Recurse -EnableExit
109109
110- - name : Run Pester tests and generate code coverage report
111- shell : pwsh
110+ - name : Run Pester tests on Windows PowerShell to ensure backward compatibility
111+ shell : powershell
112112 run : |
113113 Write-Output "Pester version being used:"
114114 Import-Module -Name Pester
@@ -120,18 +120,14 @@ jobs:
120120 Run = @{ Throw = $true }
121121 TestResult = @{
122122 Enabled = $true
123- OutputPath = 'test-results-pwsh-nunit.xml'
124- }
125- CodeCoverage = @{
126- Enabled = $true
127- OutputPath = 'code-coverage-jacoco.xml'
128- Path = 'src/' # Only include code coverage for the module's source code, not build or deployment scripts.
123+ OutputPath = 'test-results-windows-powershell-nunit.xml'
129124 }
125+ CodeCoverage = @{ Enabled = $false }
130126 }
131127 Invoke-Pester -Configuration $pesterConfig
132128
133- - name : Run Pester tests on Windows PowerShell to ensure backward compatibility
134- shell : powershell
129+ - name : Run Pester tests and generate code coverage report
130+ shell : pwsh
135131 run : |
136132 Write-Output "Pester version being used:"
137133 Import-Module -Name Pester
@@ -143,9 +139,13 @@ jobs:
143139 Run = @{ Throw = $true }
144140 TestResult = @{
145141 Enabled = $true
146- OutputPath = 'test-results-windows-powershell-nunit.xml'
142+ OutputPath = 'test-results-pwsh-nunit.xml'
143+ }
144+ CodeCoverage = @{
145+ Enabled = $true
146+ OutputPath = 'code-coverage-jacoco.xml'
147+ Path = 'src/' # Only include code coverage for the module's source code, not build or deployment scripts.
147148 }
148- CodeCoverage = @{ Enabled = $false }
149149 }
150150 Invoke-Pester -Configuration $pesterConfig
151151
0 commit comments