Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add windows to matrix tests #139

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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":
Expand Down
6 changes: 6 additions & 0 deletions magefiles/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"os"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -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
Copy link
Owner

@philippgille philippgille Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unlikely that there will be Windows specific images for many of the services, so I was hoping we could either

  • Switch the Docker daemon to Linux mode (like this), but apparently the GitHub Action Windows runners don't support it (source)
  • Or run Docker in WSL 2, but apparently the GitHub Action Windows runners only support WSL 1 (source)

So we're out of luck. Let's see if the situation improves in the future. For now it's already a win to test the other gokv stores that don't rely on services running in Docker 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one for mongo
https://hub.docker.com/_/mongo/tags?page=1&name=windows
but yeah, was exploring both options for above points you made as well

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 != "" {
Expand Down
Loading