Skip to content

Commit b0ddbcc

Browse files
🩹 [Refactor]: Remove redundant checkout step and add Get-CodeCoverage workflow for enhanced test coverage analysis
1 parent 94f5d3c commit b0ddbcc

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Get-CodeCoverage
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
Debug:
7+
type: boolean
8+
description: Enable debug output.
9+
required: false
10+
default: false
11+
Verbose:
12+
type: boolean
13+
description: Enable verbose output.
14+
required: false
15+
default: false
16+
Version:
17+
type: string
18+
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
19+
required: false
20+
default: ''
21+
Prerelease:
22+
type: boolean
23+
description: Whether to use a prerelease version of the 'GitHub' module.
24+
required: false
25+
default: false
26+
WorkingDirectory:
27+
type: string
28+
description: The working directory where the script will run from.
29+
required: false
30+
default: ${{ github.workspace }}
31+
32+
permissions:
33+
contents: read # to checkout the repo
34+
35+
jobs:
36+
Get-CodeCoverage:
37+
name: Get-CodeCoverage
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Get-CodeCoverage
41+
uses: PSModule/Get-PesterCodeCoverage@v1
42+
id: Get-CodeCoverage
43+
with:
44+
Debug: ${{ inputs.Debug }}
45+
Prerelease: ${{ inputs.Prerelease }}
46+
Verbose: ${{ inputs.Verbose }}
47+
Version: ${{ inputs.Version }}
48+
WorkingDirectory: ${{ inputs.WorkingDirectory }}

ā€Ž.github/workflows/Get-TestResults.ymlā€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ jobs:
3737
name: Get-TestResults
3838
runs-on: ubuntu-latest
3939
steps:
40-
- name: Checkout Code
41-
uses: actions/checkout@v4
42-
4340
- name: Get-TestResults
4441
uses: PSModule/Get-PesterTestResults@v1
4542
id: Get-TestResults

ā€Ž.github/workflows/workflow.ymlā€Ž

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,21 @@ jobs:
200200
Version: ${{ inputs.Version }}
201201
WorkingDirectory: ${{ inputs.WorkingDirectory }}
202202

203+
Get-CodeCoverage:
204+
name: Get-CodeCoverage
205+
needs:
206+
- Test-SourceCode
207+
- Test-Module
208+
- Test-ModuleLocal
209+
uses: ./.github/workflows/Get-CodeCoverage.yml
210+
secrets: inherit
211+
with:
212+
Debug: ${{ inputs.Debug }}
213+
Prerelease: ${{ inputs.Prerelease }}
214+
Verbose: ${{ inputs.Verbose }}
215+
Version: ${{ inputs.Version }}
216+
WorkingDirectory: ${{ inputs.WorkingDirectory }}
217+
203218
# Get-CodeCoverage:
204219
# name: Get-CodeCoverage
205220
# runs-on: ubuntu-latest

0 commit comments

Comments
Ā (0)