Skip to content

Commit

Permalink
fix: Fixing ugit workflow PublishTestResults ( Fixes #287 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Sep 25, 2024
1 parent bacdb1d commit 40d9aa1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/TestAndPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
Install-Module -Name Pester -Repository PSGallery -Force -Scope CurrentUser -MaximumVersion $PesterMaxVersion -SkipPublisherCheck -AllowClobber
Import-Module Pester -Force -PassThru -MaximumVersion $PesterMaxVersion} @Parameters
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: RunPester
id: RunPester
shell: pwsh
Expand Down Expand Up @@ -174,9 +174,6 @@ jobs:
$result =
Invoke-Pester -PassThru -Verbose -OutputFile ".\$moduleName.TestResults.xml" -OutputFormat NUnitXml @codeCoverageParameters
"::set-output name=TotalCount::$($result.TotalCount)",
"::set-output name=PassedCount::$($result.PassedCount)",
"::set-output name=FailedCount::$($result.FailedCount)" | Out-Host
if ($result.FailedCount -gt 0) {
"::debug:: $($result.FailedCount) tests failed"
foreach ($r in $result.TestResult) {
Expand All @@ -188,7 +185,7 @@ jobs:
}
} @Parameters
- name: PublishTestResults
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: PesterResults
path: '**.TestResults.xml'
Expand Down
10 changes: 10 additions & 0 deletions Build/GitHub/Steps/PublishTestResults.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@{
name = 'PublishTestResults'
uses = 'actions/upload-artifact@v3'
with = @{
name = 'PesterResults'
path = '**.TestResults.xml'
}
if = '${{always()}}'
}

0 comments on commit 40d9aa1

Please sign in to comment.