From 7e930ba86b23328f2caa8e8b5ee50f6e36f006cd Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 14 Sep 2023 14:00:01 +0200 Subject: [PATCH] test --- .github/workflows/cleanup_cache.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cleanup_cache.yml b/.github/workflows/cleanup_cache.yml index 5ef0be3618f73c..1b8f4505729f4f 100644 --- a/.github/workflows/cleanup_cache.yml +++ b/.github/workflows/cleanup_cache.yml @@ -36,20 +36,24 @@ jobs: done BRANCH="master" - KEY="ccache-linux-ubuntu" - echo "Fetching list of cache key for ${BRANCH}" - cacheKeysForPR=( $(gh actions-cache list -R $REPO -B $BRANCH -L 100 --key $KEY --sort created-at --order desc | cut -f 1) ) - echo "${cacheKeysForPR[@]}" - cacheKeysForPRSliced=("${cacheKeysForPR[@]:1}") - echo "${cacheKeysForPRSliced[@]}" - ## Setting this to not fail the workflow while deleting cache keys. - set +e - echo "Deleting caches..." - for cacheKey in ${cacheKeysForPRSliced[@]} + KEYS=( "ccache-linux-ubuntu", "ccache-Build-linux-debian", "ccache-Build-linux-android") + for cache_key in ${KEYS[@]} do - # gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm - echo "${cacheKey}" + echo "Fetching list of cache key for ${BRANCH}" + cacheKeysForPR=( $(gh actions-cache list -R $REPO -B $BRANCH -L 100 --key $cache_key --sort created-at --order desc | cut -f 1) ) + echo "${cacheKeysForPR[@]}" + cacheKeysForPRSliced=("${cacheKeysForPR[@]:1}") + echo "${cacheKeysForPRSliced[@]}" + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in ${cacheKeysForPRSliced[@]} + do + # gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + echo "${cacheKey}" + done done + echo "Done" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file