-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env sh | ||
# aarch64-macos CI script to clean cache, if necessary | ||
|
||
# set -x | ||
set -o errexit # abort on nonzero exitstatus | ||
set -o nounset # abort on unbound variable | ||
|
||
MAX_SIZE_B=2147483648 #2 GB = 2*(1024)**3 B | ||
ZIG_CACHE_DIR="$(zig env | jq '. "global_cache_dir"')" | ||
CHECK_SIZE_B=$(du -sb "$ZIG_CACHE_DIR" | cut -f1) | ||
if test "$CHECK_SIZE_B" -ge $MAX_SIZE_B; then | ||
rm -fr "$ZIG_CACHE_DIR" | ||
fi | ||
|
||
zig env | ||
|
||
zig build -Dno_opt_deps -Dno_cross test --summary all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env sh | ||
# x86_64-linux CI script to clean cache, if necessary | ||
|
||
# set -x | ||
set -o errexit # abort on nonzero exitstatus | ||
set -o nounset # abort on unbound variable | ||
|
||
MAX_SIZE_B=2147483648 #2 GB = 2*(1024)**3 B | ||
ZIG_CACHE_DIR="$(zig env | jq '. "global_cache_dir"')" | ||
CHECK_SIZE_B=$(du -sb "$ZIG_CACHE_DIR" | cut -f1) | ||
if test "$CHECK_SIZE_B" -ge $MAX_SIZE_B; then | ||
rm -fr "$ZIG_CACHE_DIR" | ||
fi | ||
|
||
zig env | ||
|
||
zig build -Dno_opt_deps -Dno_cross test --summary all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# x86_64-windows CI script to clean cache, if necessary | ||
function CheckLastExitCode { | ||
if (!$?) { exit 1 } | ||
return 0 | ||
} | ||
|
||
[int] $MAX_SIZE_B = 2147483648 #2 GB = 2*(1024)**3 B | ||
[string] $ZIG_CACHE_DIR = $(zig env | jq '. "global_cache_dir"') | ||
[int] $CHECK_SIZE_B = [int]$(gci $ZIG_CACHE_DIR | measure Length -s).Sum | ||
if ($CHECK_SIZE_B -gt $MAX_SIZE_B) { | ||
Remove-Item -Recurse -Force -ErrorAction Ignore -Path $ZIG_CACHE_DIR | ||
CheckLastExitCode | ||
} | ||
|
||
zig env | ||
CheckLastExitCode | ||
|
||
zig build -Dno_opt_deps -Dno_cross test --summary all | ||
CheckLastExitCode |