From 8c840893b7630be7f5ff5f699aeff1464b5900dc Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Dec 2021 14:24:54 +0100 Subject: [PATCH] Add a GitHub workflow for testing Signed-off-by: Johannes Schindelin --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..5f688fdb0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: Test Posh-Git + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + shell: pwsh + run: | + "Git version: $(git --version)" + "PSVersion: $($PSVersionTable.PSVersion)" + "Host name: $($Host.Name)" + + Set-PSRepository -Name PSGallery -InstallationPolicy Trusted + Install-Module Pester -MinimumVersion 5.0.0 -MaximumVersion 5.99.99 -Scope CurrentUser -Force + - name: run tests + shell: pwsh + run: | + Import-Module Pester -PassThru + $ErrorActionPreference = 'Continue' + $res = Invoke-Pester -Path test -Output Detailed -PassThru -ErrorAction SilentlyContinue + if (!$res -or ($res.FailedCount -gt 0)) { + $Error | Format-List * -Force + exit 1 + }