Skip to content

Commit

Permalink
github: Try to fix "no space left on device" on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 31, 2024
1 parent 6bde2a5 commit 1aa5c53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ jobs:
run: |
sass --version;
mage -v check;
go clean -testcache;
env:
HUGO_BUILD_TAGS: extended
- if: matrix.os == 'windows-latest'
# See issue #11052. We limit the build to regular test (no -race flag) on Windows for now.
name: Test
run: |
mage -v test;
go clean -testcache;
env:
HUGO_BUILD_TAGS: extended
- name: Build tags
Expand Down
14 changes: 13 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ func Check() {
fmt.Printf("Skip Test386 on %s and/or %s\n", runtime.GOARCH, runtime.GOOS)
}

mg.Deps(Fmt, Vet)
if isCi() && isDarwin() {
// Skip on macOS in CI (disk space issues)
} else {
mg.Deps(Fmt, Vet)
}

// don't run two tests in parallel, they saturate the CPUs anyway, and running two
// causes memory issues in CI.
Expand Down Expand Up @@ -239,6 +243,14 @@ func Lint() error {
return nil
}

func isCi() bool {
return os.Getenv("CI") != ""
}

func isDarwin() bool {
return runtime.GOOS == "darwin"
}

// Run go vet linter
func Vet() error {
if err := sh.Run(goexe, "vet", "./..."); err != nil {
Expand Down

0 comments on commit 1aa5c53

Please sign in to comment.