mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 15:26:04 +00:00
ci: keep unit-test scratch out of the runner's shared /tmp (#3083)
* ci: keep unit-test scratch out of the runner's shared /tmp Test JVMs now write temp files under the test task's build folder, which checkout wipes on every job, so a killed run no longer leaves Robolectric and JUnit folders behind in /tmp. Self-hosted runners also clear stale test folders they own in /tmp, drop the regenerable Gradle build cache when the workspace has under 20 GB free, and log disk use so a full disk is visible in the job. * test(agent): size check no longer depends on the temp path's length A symlink's own size is the length of its target path, so the old 100-byte bound failed once the temp dir moved under the build folder. * ci: never remove a mount point while clearing runner scratch * ci: keep a scratch folder that anything inside it touched recently * ci: keep a scratch folder the freshness scan could not read
This commit is contained in:
1 parent
e3b1b60914
commit
b0a8c0898e
4 files changed
+26
-2
No files matched your search
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -uo pipefail
|
||||
workspace="${1:?}"
|
||||
find /tmp -maxdepth 1 -user "$(id -u)" \( -name 'robolectric-*' -o -name 'junit*' -o -name 'gradle-*' -o -name 'kotlin-*' \) -mmin +180 -print0 |
|
||||
while IFS= read -r -d '' entry; do
|
||||
recent=$(find "$entry" -xdev -mmin -180 -print -quit 2>/dev/null) && [ -z "$recent" ] && rm -rf --one-file-system --preserve-root=all -- "$entry"
|
||||
done
|
||||
free=$(df --output=avail -k "$workspace" | tail -1)
|
||||
if [ "$free" -lt 20971520 ]; then
|
||||
rm -rf --one-file-system --preserve-root=all -- "${HOME:?}/.gradle/caches/build-cache-1" "${HOME:?}/.gradle/.tmp"
|
||||
fi
|
||||
df -h /tmp "$workspace"
|
||||
du -xsh /tmp "${HOME:?}/.gradle" "${HOME:?}/.cargo" "${HOME:?}/.m2" "$(dirname "$workspace")" 2>/dev/null | sort -h
|
||||
exit 0
|
||||
Reference in new issue
Block a user