openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.83k stars 2.56k forks source link

Github Actions Cache #8008

Open danoli3 opened 1 month ago

danoli3 commented 1 month ago

Looks like we haven't been cleaning up caches

image

Cache list : https://github.com/openframeworks/openFrameworks/actions/caches

https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries

Shall test adding cache clean to PR on close

danoli3 commented 1 month ago

Added cleanup on PR close again should help fix some of the issues

danoli3 commented 4 weeks ago

current cache cleaning not working:

gh extension install actions/gh-actions-cache
  REPO=openframeworks/openFrameworks
  BRANCH="refs/pull/8007/merge"
  echo "Fetching list of cache key"
  cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
  ## Setting this to not fail the workflow while deleting cache keys.
  set +e
  echo "Deleting caches..."
  for cacheKey in $cacheKeysForPR
  do
      gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
  done
  echo "Done"
  shell: /usr/bin/bash -e {0}
  env:
    GH_TOKEN: ***
Fetching list of cache key
Deleting caches...
Error: Resource not accessible by integration
Error: Resource not accessible by integration
Error: Resource not accessible by integration
Error: Resource not accessible by integration
Error: Resource not accessible by integration
Done