@@ -148,19 +148,75 @@ jobs:
148
148
# Verbose: ${{ inputs.Verbose }}
149
149
# Version: ${{ inputs.Version }}
150
150
151
+ # Gather-Tests:
152
+ # # if: ${{ needs.Build-Module.result == 'success' && !cancelled() }}
153
+ # # needs:
154
+ # # - Build-Module
155
+ # uses: ./.github/workflows/Gather-Tests.yml
156
+ # with:
157
+ # Path: ${{ inputs.Path }}
158
+
151
159
Gather-Tests :
152
- # if: ${{ needs.Build-Module.result == 'success' && !cancelled() }}
153
- # needs:
154
- # - Build-Module
155
- uses : ./.github/workflows/Gather-Tests.yml
156
- with :
157
- Path : ${{ inputs.Path }}
160
+ name : Gather-Tests
161
+ runs-on : ubuntu-latest
162
+ outputs :
163
+ TestSuites : ${{ fromJson(steps.Gather-Tests.outputs.result).TestSuites }}
164
+ steps :
165
+ - name : Checkout Code
166
+ uses : actions/checkout@v4
167
+
168
+ - name : Gather-Tests
169
+ uses : PSModule/GitHub-Script@v1
170
+ id : Gather-Tests
171
+ with :
172
+ ShowOutput : true
173
+ WorkingDirectory : ${{ inputs.Path }}
174
+ Script : |
175
+ $shellsToTest = @('pwsh')
176
+ $OSsToTest = @('ubuntu-latest', 'macos-latest', 'windows-latest')
177
+
178
+ $testsPath = Resolve-Path 'tests' | Select-Object -ExpandProperty Path
179
+ if (-not (Test-Path -Path $testsPath)) {
180
+ Write-Host "No tests found"
181
+ exit 0
182
+ }
183
+
184
+ Write-Host "Tests found at [$testsPath]"
185
+
186
+ $testSuites = @()
187
+ Get-ChildItem -Path $testsPath -Directory | ForEach-Object {
188
+ $testSuites += $_.FullName
189
+ }
190
+ if (-not $testSuites) {
191
+ $testSuites += @($testsPath)
192
+ }
193
+
194
+ $testSuites | Format-List
195
+
196
+ $tests = @{
197
+ OS = $OSsToTest
198
+ Path = $testSuites
199
+ }
200
+
201
+ $testsJson = $tests | ConvertTo-Json -Depth 10 -Compress
202
+
203
+ Write-Output $testsJson
204
+
205
+ Set-GitHubOutput -Name Tests -Value $tests -Verbose -Debug -Confirm:$false
206
+ $output = Get-Content $env:GITHUB_OUTPUT -Raw
207
+ Write-Output $output
208
+ Set-GitHubStepSummary -Summary $output
209
+
210
+
211
+
212
+
213
+
158
214
159
215
TestModuleLocal :
160
216
needs :
161
217
- Gather-Tests
162
218
strategy :
163
- matrix : ${{ toJson (needs.Gather-Tests.outputs.TestSuites) }}
219
+ matrix : ${{ fromJson (needs.Gather-Tests.outputs.TestSuites) }}
164
220
runs-on : ${{ matrix.OS }}
165
221
steps :
166
222
- name : Test
0 commit comments