Skip to content

Commit f3294b7

Browse files
🩹 [Refactor]: Rename Gather-Tests workflow to Get-TestSuites and update job dependencies
1 parent 9a56154 commit f3294b7

File tree

3 files changed

+44
-16
lines changed

3 files changed

+44
-16
lines changed

‎.github/workflows/CI.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,42 @@ jobs:
141141
Verbose: ${{ inputs.Verbose }}
142142
Version: ${{ inputs.Version }}
143143

144-
Gather-Tests:
145-
if: ${{ needs.Build-Module.result == 'success' && !cancelled() }}
146-
needs:
147-
- Build-Module
148-
uses: ./.github/workflows/Gather-Tests.yml
144+
Get-TestSuites:
145+
uses: ./.github/workflows/Get-TestSuites.yml
149146
with:
150147
Path: ${{ inputs.Path }}
151148

149+
TestModuleLocal:
150+
needs:
151+
- Get-TestSuites
152+
strategy:
153+
matrix: ${{ fromJson(needs.Get-TestSuites.outputs.TestSuites) }}
154+
runs-on: ${{ matrix.OS }}
155+
steps:
156+
- name: Test
157+
shell: pwsh
158+
run: |
159+
$suite = '${{ matrix.Path }}'
160+
if ($IsLinux) {
161+
throw "Linux is not supported"
162+
}
163+
Write-Host "Running test suite: $suite"
164+
165+
Status:
166+
name: Status
167+
runs-on: ubuntu-latest
168+
needs:
169+
- TestModule
170+
- TestModuleLocal
171+
steps:
172+
- name: Status
173+
shell: pwsh
174+
run: |
175+
[pscustomobject]@{
176+
TestModule = '${{ needs.TestModule.result }}'
177+
TestModuleLocal = '${{ needs.TestModuleLocal.result }}'
178+
}
179+
152180
# # This is necessary as there is no way to get output from a matrix job
153181
# TestModule-pwsh-ubuntu-latest:
154182
# name: Test module (pwsh, ubuntu-latest)

‎.github/workflows/Gather-Tests.yml renamed to ‎.github/workflows/Get-TestSuites.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Gather-Tests
1+
name: Get-TestSuites
22

33
on:
44
workflow_call:
@@ -31,24 +31,24 @@ on:
3131
outputs:
3232
TestSuites:
3333
description: The test suites to run.
34-
value: ${{ jobs.Gather-Tests.outputs.TestSuites }}
34+
value: ${{ jobs.Get-TestSuites.outputs.TestSuites }}
3535

3636
permissions:
3737
contents: read # to checkout the repo
3838

3939
jobs:
40-
Gather-Tests:
41-
name: Gather-Tests
40+
Get-TestSuites:
41+
name: Get-TestSuites
4242
runs-on: ubuntu-latest
4343
outputs:
44-
TestSuites: ${{ fromJson(steps.Gather-Tests.outputs.result).TestSuites }}
44+
TestSuites: ${{ fromJson(steps.Get-TestSuites.outputs.result).TestSuites }}
4545
steps:
4646
- name: Checkout Code
4747
uses: actions/checkout@v4
4848

49-
- name: Gather-Tests
49+
- name: Get-TestSuites
5050
uses: PSModule/GitHub-Script@v1
51-
id: Gather-Tests
51+
id: Get-TestSuites
5252
with:
5353
ShowOutput: true
5454
WorkingDirectory: ${{ inputs.Path }}

‎.github/workflows/workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,16 @@ jobs:
148148
Verbose: ${{ inputs.Verbose }}
149149
Version: ${{ inputs.Version }}
150150

151-
Gather-TestSuites:
152-
uses: ./.github/workflows/Gather-Tests.yml
151+
Get-TestSuites:
152+
uses: ./.github/workflows/Get-TestSuites.yml
153153
with:
154154
Path: ${{ inputs.Path }}
155155

156156
TestModuleLocal:
157157
needs:
158-
- Gather-TestSuites
158+
- Get-TestSuites
159159
strategy:
160-
matrix: ${{ needs.Gather-TestSuites.outputs.TestSuites }}
160+
matrix: ${{ fromJson(needs.Get-TestSuites.outputs.TestSuites) }}
161161
runs-on: ${{ matrix.OS }}
162162
steps:
163163
- name: Test

0 commit comments

Comments
 (0)