From e9fb645b98f162f934df876421ff3c5e51c8782e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 2 Jun 2024 13:42:51 +0200 Subject: [PATCH] Exit-1 if invoke-pester created error entries --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d799467e3..b359ac458 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -320,12 +320,14 @@ jobs: - name: Run Pester tests (PowerShell) run: | - Write-host $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor + $PSVersionTable Set-PSRepository psgallery -InstallationPolicy trusted Install-Module -Name Pester -RequiredVersion 5.3.1 -Confirm:$false -Force - + $Error.clear() Invoke-Pester -Path "tests" -CI - shell: pwsh + if ($Error.Length -gt 0) {exit 1} + + shell: powershell - name: Discord notification uses: rjstone/discord-webhook-notify@v1