Skip to content

Commit 469afe7

Browse files
committed
Run Windows PowerShell tests after Pwsh Pester tests for troubleshooting
1 parent f578dec commit 469afe7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/build-and-test-powershell-module.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ jobs:
107107
shell: pwsh
108108
run: Invoke-ScriptAnalyzer -Path . -Recurse -EnableExit
109109

110-
- name: Run Pester tests on Windows PowerShell to ensure backward compatibility
111-
shell: powershell
110+
- name: Run Pester tests and generate code coverage report
111+
shell: pwsh
112112
run: |
113113
Write-Output "Pester version being used:"
114114
Import-Module -Name Pester
@@ -120,14 +120,18 @@ jobs:
120120
Run = @{ Throw = $true }
121121
TestResult = @{
122122
Enabled = $true
123-
OutputPath = 'test-results-windows-powershell-nunit.xml'
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.
124129
}
125-
CodeCoverage = @{ Enabled = $false }
126130
}
127131
Invoke-Pester -Configuration $pesterConfig
128132
129-
- name: Run Pester tests and generate code coverage report
130-
shell: pwsh
133+
- name: Run Pester tests on Windows PowerShell to ensure backward compatibility
134+
shell: powershell
131135
run: |
132136
Write-Output "Pester version being used:"
133137
Import-Module -Name Pester
@@ -139,13 +143,9 @@ jobs:
139143
Run = @{ Throw = $true }
140144
TestResult = @{
141145
Enabled = $true
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.
146+
OutputPath = 'test-results-windows-powershell-nunit.xml'
148147
}
148+
CodeCoverage = @{ Enabled = $false }
149149
}
150150
Invoke-Pester -Configuration $pesterConfig
151151

0 commit comments

Comments
 (0)