Skip to content

Commit

Permalink
[actions] in .github/workflows/manual*, modify cleanup job to delete …
Browse files Browse the repository at this point in the history
…all caches except most recent one (instead of deleting them all)
  • Loading branch information
valassi committed Nov 3, 2023
1 parent 51bb70a commit aaedc8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function tput_ini() {
echo "ccache -s (before the builds)"
ccache -s
# Check if googletest has already been installed and configured
echo
if [ -d ${topdir}/test/googletest ]; then
echo "Directory ${topdir}/test/googletest already exists (retrieved from cache)"
echo "ls ${topdir}/test/googletest (start)"
Expand Down Expand Up @@ -144,6 +145,11 @@ function tput_fin() {
echo
echo "ccache -s (after the builds)"
ccache -s
# Check contents of googletest
echo
echo "ls ${topdir}/test/googletest (start)"
ls ${topdir}/test/googletest
echo "ls ${topdir}/test/googletest (end)"
}

#----------------------------------------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
echo "List cache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc
echo "List cache keys (end)"
cacheKeys=$(gh actions-cache list -R $REPO --sort created-at --order asc | cut -f 1) # delete ALL caches
###cacheKeys=$(gh actions-cache list -R $REPO --sort created-at --order asc | cut -f 1 | head --lines=-1) # keep only the most recent cache
###cacheKeys=$(gh actions-cache list -R $REPO --sort created-at --order asc | cut -f 1) # delete ALL caches
cacheKeys=$(gh actions-cache list -R $REPO --sort created-at --order asc | cut -f 1 | head --lines=-1) # keep only the most recent cache
set +e # do not fail while deleting cache keys
echo "Deleting caches..."
for cacheKey in $cacheKeys; do gh actions-cache delete $cacheKey -R $REPO --confirm; done
Expand Down

0 comments on commit aaedc8f

Please sign in to comment.