File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 8080 @{ RunsOn = 'windows-latest'; OSName = 'Windows' }
8181 )
8282
83+ $skipTests = $env:PSMODULE_GET_TESTSUITES_INPUT_SkipTests -Split ",|\s+" | ForEach-Object { $_.Trim() }
84+
85+ if ($skipTests -contains 'All') {
86+ Write-Host "Skipping all tests as requested."
87+ Set-GitHubOutput -Name SourceCodeTestSuites -Value '[]'
88+ Set-GitHubOutput -Name ModuleTestSuites -Value '[]'
89+ Set-GitHubOutput -Name ModuleLocalTestSuites -Value '[]'
90+ exit 0
91+ }
92+
93+ # Filter out OS-specific tests early
94+ $osConfigs = $osConfigs | Where-Object { $skipTests -notcontains $_.OSName }
95+
96+ if (-not $osConfigs) {
97+ Write-Host "No OS configurations left after filtering. Exiting."
98+ Set-GitHubOutput -Name SourceCodeTestSuites -Value '[]'
99+ Set-GitHubOutput -Name ModuleTestSuites -Value '[]'
100+ Set-GitHubOutput -Name ModuleLocalTestSuites -Value '[]'
101+ exit 0
102+ }
103+
83104 # Locate the tests directory.
84105 $testsPath = Resolve-Path 'tests' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Path
85106 if (-not $testsPath -or -not (Test-Path -Path $testsPath)) {
You can’t perform that action at this time.
0 commit comments