From d56c2747e30607832e77e1e82f749cf5f9a30ae6 Mon Sep 17 00:00:00 2001 From: rkoster Date: Tue, 12 Nov 2024 11:18:10 +0100 Subject: [PATCH] Conditionally invoke windows or linux unit-test script --- .github/workflows/go.yml | 6 +++++- bin/test-unit.ps1 | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 bin/test-unit.ps1 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 785c7333..324c9d2b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,5 +12,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 - uses: golangci/golangci-lint-action@v6 - - name: Unit Tests + - name: Unit Tests (Windows) + if: runner.os == 'Windows' + run: ./bin/test-unit.ps1 + - name: Unit Tests (Linux) + if: runner.os == 'Linux' run: ./bin/test-unit diff --git a/bin/test-unit.ps1 b/bin/test-unit.ps1 new file mode 100755 index 00000000..d0a279ab --- /dev/null +++ b/bin/test-unit.ps1 @@ -0,0 +1,13 @@ +trap { + write-error $_ + exit 1 +} + +go.exe version + +go.exe run github.com/onsi/ginkgo/v2/ginkgo -r -keep-going --skip-package="vendor" +if ($LastExitCode -ne 0) +{ + Write-Error $_ + exit 1 +}