CI: add wine on Linux for the Windows e2e test

Installing it on Debian was enough, with the only wrinkle that
propagating -race won't work when we're cross-compiling, since
cross-compilation disables CGo by default.

For now, just skip the test in that edge case. If we want to use the
race detector on Windows in the future, we need to get a Windows CI
builder somehow.

Tested on my fork; see https://builds.sr.ht/~mvdan/job/164899.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
Daniel Martí
2020-03-07 20:50:59 +00:00
committed by Elias Naur
parent 49000ae4a3
commit acfe91ec3e
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ packages:
- scrot
- sway
- grim
- wine
sources:
- https://git.sr.ht/~eliasnaur/gio
environment:
+5
View File
@@ -11,6 +11,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"sync"
"time"
@@ -39,6 +40,10 @@ func (d *WineTestDriver) Start(path string) {
bin := filepath.Join(d.tempDir("gio-endtoend-windows"), "red.exe")
flags := []string{"build", "-o=" + bin}
if raceEnabled {
if runtime.GOOS != "windows" {
// cross-compilation disables CGo, which breaks -race.
d.Skipf("can't cross-compile -race for Windows; skipping")
}
flags = append(flags, "-race")
}
flags = append(flags, path)