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 80
80
@{ RunsOn = 'windows-latest'; OSName = 'Windows' }
81
81
)
82
82
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
+
83
104
# Locate the tests directory.
84
105
$testsPath = Resolve-Path 'tests' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Path
85
106
if (-not $testsPath -or -not (Test-Path -Path $testsPath)) {
You can’t perform that action at this time.
0 commit comments