From 725a44889b7c9fb547a7aa2f928385f79db58f1f 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 | 6 +++++- magefiles/magefile.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 370ec77..a3038aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,10 +3,12 @@ name: test on: [push, 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 @@ -27,6 +29,8 @@ jobs: - run: mage build # Then lint, taking `.golangci.yml` into account - uses: golangci/golangci-lint-action@v3 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 # Finally test all modules # This starts and stops Docker containers for services like PostgreSQL, Redis etc. # Takes up to 10m on GitHub Actions diff --git a/magefiles/magefile.go b/magefiles/magefile.go index c9f17b5..a2faba9 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":