From 9d2132b618631d20000738fe65379a8c3a4dc778 Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Tue, 31 Oct 2023 17:41:39 +0200 Subject: [PATCH] ci: add windows to matrix tests Fixes #140 Signed-off-by: Boris Glimcher --- .github/workflows/test.yml | 4 +++- magefiles/magefile.go | 4 ++-- magefiles/test.go | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 804b3592..449a0b64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,10 +6,12 @@ on: pull_request: jobs: build: - runs-on: ubuntu-latest strategy: + fail-fast: false matrix: go: [ '1.18', '1.19', '1.20', '1.21' ] + os: [windows-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 diff --git a/magefiles/magefile.go b/magefiles/magefile.go index c9f17b5c..a2faba9d 100644 --- a/magefiles/magefile.go +++ b/magefiles/magefile.go @@ -17,7 +17,7 @@ import ( func Update() error { switch runtime.GOOS { case "windows": - return sh.Run("./build/update-deps.ps1") + return sh.Run("pwsh.exe", "./build/update-deps.ps1") case "darwin": fallthrough case "linux": @@ -30,7 +30,7 @@ func Update() error { func Build() error { switch runtime.GOOS { case "windows": - return sh.Run("./build/build.ps1") + return sh.Run("pwsh.exe", "./build/build.ps1") case "darwin": fallthrough case "linux": diff --git a/magefiles/test.go b/magefiles/test.go index f30a9234..22f1bfc7 100644 --- a/magefiles/test.go +++ b/magefiles/test.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "os" + "runtime" "strings" "time" @@ -89,6 +90,11 @@ func testImpl(impl string) error { return errors.New("unknown `gokv.Store` implementation") } + // TODO: until docker images for windows appear, skip those test for windows + if dockerCmd != "" && runtime.GOOS == "windows" { + return nil + } + // For some implementations there's no way to test with a Docker container yet. // For them we skip the Docker stuff but still execute the tests, which can skip on connection error and we can see the skips in the test results. if dockerCmd != "" {