@@ -66,34 +66,13 @@ jobs:
6666 $config = New-PesterConfiguration
6767 $config.Run.Path = "./setup-megalinter.Tests.ps1"
6868 $config.Output.Verbosity = "Detailed"
69- $config.TestResult.Enabled = $true
70- $config.TestResult.OutputPath = "test-results.xml"
71- $config.TestResult.OutputFormat = "JUnitXml"
72- $config.CodeCoverage.Enabled = $true
73- $config.CodeCoverage.Path = "./setup-megalinter.ps1"
74- $config.CodeCoverage.OutputPath = "coverage.xml"
75- $config.CodeCoverage.OutputFormat = "JaCoCo"
7669
7770 $result = Invoke-Pester -Configuration $config
7871
7972 "failed=$($result.FailedCount)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
8073 "passed=$($result.PassedCount)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
8174
82- - name : 📊 Publish Test Results
83- if : success()
84- uses : dorny/test-reporter@v1
85- with :
86- name : Pester Results (${{ matrix.os }})
87- path : test-results.xml
88- reporter : java-junit
89- fail-on-error : false
90-
91- - name : 📈 Upload Code Coverage
92- if : success()
93- uses : actions/upload-artifact@v4
94- with :
95- name : coverage-${{ matrix.os }}
96- path : coverage.xml
97-
98- - name : ✅ All Tests Passed
99- run : echo "All ${{ matrix.os }} tests passed successfully!"
75+ - name : ✅ Tests Result
76+ run : |
77+ Write-Host "Tests completed: ${{ steps.test.outputs.passed }} passed, ${{ steps.test.outputs.failed }} failed"
78+ if (${{ steps.test.outputs.failed }} -ne 0) { exit 1 }
0 commit comments