From a87ad6f0e9929df7ccab030382de2a9f5bf67dbc Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Fri, 9 Feb 2024 08:16:21 -0500 Subject: [PATCH] actions: cache only whats necessary for platform to reduce cache size --- .github/workflows/build.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ec78b6..d4ddfc3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,14 +64,19 @@ jobs: fetch-depth: 0 - name: Cache the build + if: matrix.goal == 'build' id: cache-python-ssl uses: actions/cache@v2 with: path: | - ./ssl - ./python - ./cpython - key: ${{ matrix.jid }}-2024-02-08a + cache.tar.xz + key: ${{ matrix.jid }}-2024-02-09 + + - name: Untar Cache archive + if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true' + working-directory: ${{ github.workspace }} + run: | + tar xvvf cache.tar.xz - name: Use pre-compiled Python if: matrix.python != '' @@ -477,3 +482,14 @@ jobs: *.tar.xz *.zip *.msi + + - name: Tar Cache archive + if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }} + run: | + if [[ "${RUNNER_OS}" == "Windows" ]]; then + tar_folder="cpython/" + else + tar_folder="ssl/ python/" + fi + tar cJvvf cache.tar.xz $tar_folder