Cleanup caches #7
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
name: Cleanup caches | |
on: | |
workflow_dispatch: | |
schedule: | |
# at 00:00 on the 1st day of every month | |
- cron: '0 0 1 * *' | |
permissions: read-all | |
jobs: | |
Cleanup_PIP: | |
name: Cleanup PIP cache | |
runs-on: aks-linux-2-cores-8gb | |
if: ${{ github.repository_owner == 'openvinotoolkit' }} | |
container: | |
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04 | |
volumes: | |
- /mount:/mount | |
env: | |
PIP_CACHE_PATH: /mount/caches/pip | |
steps: | |
- name: Pre-Collecting Cache Info | |
run: | | |
echo "Cache info: " | |
du -h -d2 ${PIP_CACHE_PATH} | |
- name: Cleanup cache | |
run: | | |
echo "Delete cache files if they have not been used in over 30 days" | |
[ ! -z "${PIP_CACHE_PATH}" ] && find ${PIP_CACHE_PATH} ! -type d -atime +30 -delete | |
- name: Post-Collecting Cache Info | |
run: | | |
echo "Cache info: " | |
du -h -d2 ${PIP_CACHE_PATH} | |
Cleanup_ccache_lin: | |
name: Cleanup Linux ccache | |
runs-on: aks-linux-2-cores-8gb | |
if: ${{ github.repository_owner == 'openvinotoolkit' }} | |
container: | |
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04 | |
volumes: | |
- /mount:/mount | |
env: | |
CCACHE_PATH: /mount/caches/ccache | |
steps: | |
- name: Checkout cach action | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
with: | |
sparse-checkout: .github/actions/cache | |
- name: Cleanup ccache | |
uses: ./.github/actions/cache/cleanup | |
with: | |
cache-size: 300 | |
max-cache-size: 750 | |
cache-path: ${{ env.CCACHE_PATH }} | |
recursive: true | |
key: '.' | |
Cleanup_ccache_win: | |
name: Cleanup Windows ccache | |
runs-on: 'aks-win-4-cores-8gb' | |
env: | |
CCACHE_PATH: C:\\mount\\caches\\ccache | |
steps: | |
- name: Checkout cach action | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
sparse-checkout: .github/actions/cache | |
- name: Cleanup ccache | |
uses: ./.github/actions/cache/cleanup | |
with: | |
cache-size: 300 | |
max-cache-size: 750 | |
cache-path: C:\\mount\\caches\\ccache | |
recursive: true | |
key: '.' |