mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
github: Fix "no space left on device" issue in CI
This commit is contained in:
@@ -24,9 +24,7 @@ jobs:
|
||||
name: Free Disk Space (Ubuntu)
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
|
||||
with:
|
||||
# this might remove tools that are actually needed,
|
||||
# if set to "true" but frees about 6 GB
|
||||
tool-cache: false
|
||||
tool-cache: true
|
||||
android: true
|
||||
dotnet: true
|
||||
haskell: true
|
||||
|
||||
+15
@@ -70,6 +70,10 @@ func flagEnv() map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
func emptyEnv() map[string]string {
|
||||
return map[string]string{}
|
||||
}
|
||||
|
||||
// Generate autogen packages
|
||||
func Generate() error {
|
||||
generatorPackages := []string{
|
||||
@@ -138,6 +142,9 @@ func Docker() error {
|
||||
func Check() {
|
||||
if runtime.GOARCH == "amd64" && runtime.GOOS != "darwin" {
|
||||
mg.Deps(Test386)
|
||||
if isCI() {
|
||||
mg.Deps(CleanTest)
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("Skip Test386 on %s and/or %s\n", runtime.GOARCH, runtime.GOOS)
|
||||
}
|
||||
@@ -151,6 +158,9 @@ func Check() {
|
||||
// don't run two tests in parallel, they saturate the CPUs anyway, and running two
|
||||
// causes memory issues in CI.
|
||||
mg.Deps(TestRace)
|
||||
if isCI() {
|
||||
mg.Deps(CleanTest)
|
||||
}
|
||||
}
|
||||
|
||||
func testGoFlags() string {
|
||||
@@ -161,6 +171,11 @@ func testGoFlags() string {
|
||||
return "-timeout=1m"
|
||||
}
|
||||
|
||||
// Clean Go's test cache.
|
||||
func CleanTest() error {
|
||||
return runCmd(emptyEnv(), goexe, "clean", "-testcache")
|
||||
}
|
||||
|
||||
// Run tests in 32-bit mode
|
||||
// Note that we don't run with the extended tag. Currently not supported in 32 bit.
|
||||
func Test386() error {
|
||||
|
||||
Reference in New Issue
Block a user