Skip to content

Commit aa26b14

Browse files
committed
Create a simple Pester summary
1 parent 53d6b56 commit aa26b14

1 file changed

Lines changed: 25 additions & 29 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
permissions:
1010
contents: write # to tag the repository
11-
checks: write # to create the check runs results (from zyborg/pester-tests-report)
11+
checks: write # to create the check runs results
1212

1313
jobs:
1414
build:
@@ -72,16 +72,13 @@ jobs:
7272
os: [ windows-latest, ubuntu-latest, macos-latest ]
7373
steps:
7474
- name: Download build.requires.psd1
75-
uses: actions/download-artifact@v4
75+
uses: actions/download-artifact@v8
7676
with:
7777
name: build.requires.psd1
78-
- name: Download Pester Tests
79-
uses: actions/download-artifact@v4
80-
with:
81-
name: PesterTests
82-
path: PesterTests
78+
- name: ⚡ Install Required Modules
79+
uses: JustinGrote/ModuleFast-action@v0.0.1
8380
- name: Download Build Output
84-
uses: actions/download-artifact@v4
81+
uses: actions/download-artifact@v8
8582
with:
8683
name: ModuleBuilder
8784
path: output/ModuleBuilder # /home/runner/work/ModuleBuilder/ModuleBuilder/output/ModuleBuilder
@@ -106,28 +103,27 @@ jobs:
106103
@(Get-Content build.requires.psd1)
107104
| Where { $_ -notmatch "ModuleBuilder"}
108105
| Set-Content build.requires.psd1
109-
- name: ⚡ Install Required Modules
110-
uses: JustinGrote/ModuleFast-action@v0.0.1
111-
112-
- name: Invoke Pester Tests
113-
id: pester
114-
uses: zyborg/pester-tests-report@v1
106+
- name: Download Pester Tests
107+
uses: actions/download-artifact@v8
115108
with:
116-
# include_paths: tests
117-
# exclude_paths: tests/powershell1,tests/powershell2
118-
# exclude_tags: skip_ci
119-
report_name: ${{ matrix.os }}_validation
120-
report_title: My Module Tests
121-
github_token: ${{ secrets.GITHUB_TOKEN }}
122-
tests_fail_step: true
123-
skip_check_run: false # Our test results are too large
124-
- name: Summarize test results
109+
name: PesterTests
110+
path: PesterTests
111+
- name: Install Output Modules
125112
shell: pwsh
126113
run: | # PowerShell
127-
Write-ActionInfo 'Total Tests Executed...: ${{ steps.pester.outputs.total_count }}'
128-
Write-ActionInfo 'Total Tests Passed.....: ${{ steps.pester.outputs.passed_count }}'
129-
if (${{ steps.pester.outputs.failed_count }} -gt 0) {
130-
Set-ActionFailed 'Total Tests Failed.....: ${{ steps.pester.outputs.failed_count }}'
131-
} else {
132-
Write-ActionInfo 'Total Tests Failed.....: ${{ steps.pester.outputs.failed_count }}'
114+
# For the cross-platform matrix we don't need to do coverage or anything complicated
115+
$Result = Invoke-Pester . -PassThru
116+
@(
117+
"## Pester Tests for ${{ matrix.os }}"
118+
""
119+
$Result.Duration.ToString()
120+
"| Total | Passed | Failed |"
121+
"|------:|-------:|-------:|"
122+
"| $($Result.TotalCount) | $($Result.PassedCount) | $($Result.FailedCount) |"
123+
""
124+
"| Duration | Total | Passed | Failed | Skipped | Name |"
125+
"|---------:|------:|-------:|-------:|--------:|:-----|"
126+
@($Result.Containers).ForEach{
127+
"| $($_.Duration) | $($_.TotalCount) | $($_.PassedCount) | $($_.FailedCount) | $($_.SkippedCount) | $($_.Name) |"
133128
}
129+
) | Out-File -FilePath $env:GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)