26f897c1ec
release / release-please (push) Failing after 1m49s
docs / build (push) Failing after 6m34s
release / build-and-upload (arm64, linux) (push) Has been cancelled
release / build-and-upload (arm64, windows) (push) Has been cancelled
release / build-darwin (amd64, darwin) (push) Has been cancelled
release / checksums (push) Has been cancelled
release / finalize (push) Has been cancelled
release / build-darwin (arm64, darwin) (push) Has been cancelled
release / build-and-upload (amd64, linux) (push) Has been cancelled
release / build-and-upload (amd64, windows) (push) Has been cancelled
docs / deploy (push) Has been cancelled
37 lines
943 B
Go
37 lines
943 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestCIWorkflowRunsTestsOnAllSupportedDesktopPlatforms(t *testing.T) {
|
|
data, err := os.ReadFile(".github/workflows/ci.yml")
|
|
if err != nil {
|
|
t.Fatalf("read workflow: %v", err)
|
|
}
|
|
|
|
content := string(data)
|
|
for _, osName := range []string{"ubuntu-latest", "macos-latest", "windows-latest"} {
|
|
if !strings.Contains(content, osName) {
|
|
t.Fatalf("CI workflow must test %q", osName)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestCIWorkflowUsesRaceTestsOnUnixRunners(t *testing.T) {
|
|
data, err := os.ReadFile(".github/workflows/ci.yml")
|
|
if err != nil {
|
|
t.Fatalf("read workflow: %v", err)
|
|
}
|
|
|
|
content := string(data)
|
|
if !strings.Contains(content, "if: runner.os != 'Windows'") {
|
|
t.Fatalf("CI workflow must keep the Unix test branch so macOS runs the Unix suite")
|
|
}
|
|
if !strings.Contains(content, "run: go test -race ./...") {
|
|
t.Fatalf("CI workflow must run the race-enabled suite on Unix runners")
|
|
}
|
|
}
|