From 281ce8c7dc5f57d7619a0f1031aa65ab9b42bb40 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 5 Apr 2024 16:10:33 +0200 Subject: [PATCH] [GHA] Cleanup ccache shares (#23894) ### Details: - Added job to automatically cleanup compressed caches - Disable creation of the cache for each commit in risc-v pipeline ### Tickets: - *ticket-id* --- ...eanup_pip_cache.yml => cleanup_caches.yml} | 27 +++++++++++++++++-- .github/workflows/linux_riscv.yml | 5 ++-- 2 files changed, 27 insertions(+), 5 deletions(-) rename .github/workflows/{cleanup_pip_cache.yml => cleanup_caches.yml} (55%) diff --git a/.github/workflows/cleanup_pip_cache.yml b/.github/workflows/cleanup_caches.yml similarity index 55% rename from .github/workflows/cleanup_pip_cache.yml rename to .github/workflows/cleanup_caches.yml index 355d0d68d7cf93..c18e8ca5828f69 100644 --- a/.github/workflows/cleanup_pip_cache.yml +++ b/.github/workflows/cleanup_caches.yml @@ -1,4 +1,4 @@ -name: Cleanup PIP caches +name: Cleanup caches on: workflow_dispatch: schedule: @@ -6,7 +6,7 @@ on: - cron: '0 0 1 * *' jobs: - Cleanup_PIP_Caches: + Cleanup_PIP: runs-on: aks-linux-2-cores-8gb container: image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04 @@ -30,3 +30,26 @@ jobs: run: | echo "Cache info: " du -h -d2 ${PIP_CACHE_PATH} + + Cleanup_CCACHE: + runs-on: aks-linux-2-cores-8gb + container: + image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04 + volumes: + - /mount:/mount + env: + CCACHE_PATH: /mount/caches/ccache/ubuntu22_riscv64 + + steps: + - name: Checkout cach action + uses: actions/checkout@v4 + with: + sparse-checkout: .github/actions/cache + + - name: Cleanup ccache + uses: ./.github/actions/cache/cleanup + with: + cache-size: 10 + max-cache-size: 50 + cache-path: ${{ env.CCACHE_PATH }} + key: '*' diff --git a/.github/workflows/linux_riscv.yml b/.github/workflows/linux_riscv.yml index 87ac7c117e8d87..78b65179a9d8c5 100644 --- a/.github/workflows/linux_riscv.yml +++ b/.github/workflows/linux_riscv.yml @@ -90,16 +90,15 @@ jobs: id: ccache_restore uses: ./openvino/.github/actions/cache with: - save-always: true + save-always: ${{ github.event_name == 'push' && 'true' || 'false' }} cleanup-always: ${{ github.event_name == 'push' && 'true' || 'false' }} cache-size: 10 max-cache-size: 50 cache-path: ${{ env.CCACHE_REMOTE_DIR }} path: ${{ env.CCACHE_DIR }} - key: ${{ runner.os }}-${{ runner.arch }}-${{ github.ref_name == 'master' && '' || github.event.number }}ccache-${{ github.sha }} + key: ${{ runner.os }}-${{ runner.arch }}-ccache-${{ github.sha }} restore-keys: | ${{ runner.os }}-${{ runner.arch }}-ccache - ${{ runner.os }}-${{ runner.arch }}-${{ github.event.number }}ccache - name: Init submodules for non-Conan dependencies run: |