Skip to content

Commit 2a58d88

Browse files
committed
ci: Run Windows PowerShell tests first
1 parent 1761c89 commit 2a58d88

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

+12-12
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 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

Comments
 (0)