From: Bjørn Erik Pedersen Date: Mon, 24 Nov 2025 17:38:21 +0000 (+0100) Subject: github: More disk space saving optimizations X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=30dc75e620f6b374b5024022b6a99569aadd419f;p=brevno-suite%2Fhugo github: More disk space saving optimizations --- diff --git a/magefile.go b/magefile.go index 0f86236b0..b75491192 100644 --- a/magefile.go +++ b/magefile.go @@ -188,7 +188,27 @@ func Test() error { // Run tests with race detector func TestRace() error { env := map[string]string{"GOFLAGS": testGoFlags()} - return runCmd(env, goexe, "test", "-p", "2", "-race", "./...", "-tags", buildTags()) + if isCI() { + // We have space issues on GitHub Actions (lots tests, incresing usage of Go generics). + // Test each package separately and clean up in between. + pkgs, err := hugoPackages() + if err != nil { + return err + } + for _, pkg := range pkgs { + if pkg == "." { + continue + } + if err := runCmd(env, goexe, "test", "-p", "2", "-race", pkg, "-tags", buildTags()); err != nil { + return err + } + mg.Deps(CleanTest, UninstallAll) + } + return nil + + } else { + return runCmd(env, goexe, "test", "-p", "2", "-race", "./...", "-tags", buildTags()) + } } // Run gofmt linter