Skip to content

Commit 3e25e4c

Browse files
Move matrix strategy into Test-ModuleLocal workflow and update calling workflows
Co-authored-by: MariusStorhaug <[email protected]>
1 parent f6fef54 commit 3e25e4c

File tree

3 files changed

+12
-36
lines changed

3 files changed

+12
-36
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,10 @@ jobs:
181181
needs:
182182
- Build-Module
183183
- Get-Settings
184-
strategy:
185-
fail-fast: false
186-
matrix:
187-
include: ${{ fromJson(needs.Get-Settings.outputs.ModuleTestSuites) }}
188184
uses: ./.github/workflows/Test-ModuleLocal.yml
189185
secrets: inherit
190186
with:
191-
RunsOn: ${{ matrix.RunsOn }}
192-
OS: ${{ matrix.OSName }}
193-
TestPath: ${{ matrix.TestPath }}
194-
TestName: ${{ matrix.TestName }}
187+
ModuleTestSuites: ${{ needs.Get-Settings.outputs.ModuleTestSuites }}
195188
Name: ${{ fromJson(needs.Get-Settings.outputs.Settings).Name }}
196189
Debug: ${{ inputs.Debug }}
197190
Prerelease: ${{ inputs.Prerelease }}

.github/workflows/Test-ModuleLocal.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,14 @@ on:
2525
description: The classic personal access token for running tests.
2626
required: false
2727
inputs:
28-
RunsOn:
28+
ModuleTestSuites:
2929
type: string
30-
description: The type of runner to use for the job.
31-
required: true
32-
OS:
33-
type: string
34-
description: The operating system name.
30+
description: JSON array of module test suites to run (from Get-Settings output).
3531
required: true
3632
Name:
3733
type: string
3834
description: The name of the module to process. Scripts default to the repository name if nothing is specified.
3935
required: false
40-
TestPath:
41-
type: string
42-
description: The path to the tests folder.
43-
required: false
44-
default: tests
45-
TestName:
46-
type: string
47-
description: The path to the tests folder.
48-
required: false
49-
default: tests
5036
Debug:
5137
type: boolean
5238
description: Enable debug output.
@@ -169,10 +155,14 @@ jobs:
169155
}
170156
171157
Test-ModuleLocal:
172-
name: Test-${{ inputs.TestName }} (${{ inputs.RunsOn }})
173-
runs-on: ${{ inputs.RunsOn }}
158+
name: Test-${{ matrix.TestName }} (${{ matrix.OSName }})
159+
runs-on: ${{ matrix.RunsOn }}
174160
needs:
175161
- BeforeAll-ModuleLocal
162+
strategy:
163+
fail-fast: false
164+
matrix:
165+
include: ${{ fromJson(inputs.ModuleTestSuites) }}
176166
steps:
177167
- name: Checkout Code
178168
uses: actions/checkout@v5
@@ -213,14 +203,14 @@ jobs:
213203
Prerelease: ${{ inputs.Prerelease }}
214204
Verbose: ${{ inputs.Verbose }}
215205
Version: ${{ inputs.Version }}
216-
TestResult_TestSuiteName: ${{ inputs.TestName }}-${{ inputs.OS }}
206+
TestResult_TestSuiteName: ${{ matrix.TestName }}-${{ matrix.OSName }}
217207
TestResult_Enabled: true
218208
CodeCoverage_Enabled: true
219209
Output_Verbosity: Detailed
220210
CodeCoverage_OutputFormat: JaCoCo
221211
CodeCoverage_CoveragePercentTarget: 0
222212
Filter_ExcludeTag: Flaky
223-
Path: ${{ inputs.TestPath }}
213+
Path: ${{ matrix.TestPath }}
224214
Run_Path: ${{ steps.import-module.outputs.path }}
225215
WorkingDirectory: ${{ inputs.WorkingDirectory }}
226216
Prescript: | # This is to speed up module loading in Pester.

.github/workflows/workflow.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,10 @@ jobs:
183183
needs:
184184
- Build-Module
185185
- Get-Settings
186-
strategy:
187-
fail-fast: false
188-
matrix:
189-
include: ${{ fromJson(needs.Get-Settings.outputs.ModuleTestSuites) }}
190186
uses: ./.github/workflows/Test-ModuleLocal.yml
191187
secrets: inherit
192188
with:
193-
RunsOn: ${{ matrix.RunsOn }}
194-
OS: ${{ matrix.OSName }}
195-
TestPath: ${{ matrix.TestPath }}
196-
TestName: ${{ matrix.TestName }}
189+
ModuleTestSuites: ${{ needs.Get-Settings.outputs.ModuleTestSuites }}
197190
Name: ${{ fromJson(needs.Get-Settings.outputs.Settings).Name }}
198191
Debug: ${{ inputs.Debug }}
199192
Prerelease: ${{ inputs.Prerelease }}

0 commit comments

Comments
 (0)