diff --git a/.github/actions/preload-img-cache/action.yml b/.github/actions/preload-img-cache/action.yml index 073fb33..bdb5fe5 100644 --- a/.github/actions/preload-img-cache/action.yml +++ b/.github/actions/preload-img-cache/action.yml @@ -20,9 +20,14 @@ runs: - uses: actions/cache@v3 id: cache-img with: - key: img-${{ hashFiles(inputs.test-db-path) }}-${{ inputs.device }} + key: img-v2-${{ hashFiles(inputs.test-db-path) }}-${{ inputs.device }} path: | - workdir/${{ inputs.filename }} + workdir/${{ inputs.filename }}-sparse.tar + - if: ${{ steps.cache-img.outputs.cache-hit }} + name: Extracting image from sparse archive + shell: sh + run: | + tar -C workdir -xf workdir/${{ inputs.filename }}-sparse.tar - if: ${{ ! steps.cache-img.outputs.cache-hit }} uses: awalsh128/cache-apt-pkgs-action@v1 with: @@ -45,3 +50,8 @@ runs: --db ${{ inputs.test-db-path }} \ --output workdir/${{ inputs.filename }} \ ${{ inputs.device }} + - if: ${{ ! steps.cache-img.outputs.cache-hit }} + name: Creating sparse archive from image + shell: sh + run: | + tar -C workdir --sparse -cf workdir/${{ inputs.filename }}-sparse.tar ${{ inputs.filename }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c66043..f3e9dc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: --method GET \ -H 'Accept: application/vnd.github+json' \ -H 'X-GitHub-Api-Version: 2022-11-28' \ - -f 'key=img-${{ hashFiles(env.test-db-path) }}-' \ + -f 'key=img-v2-${{ hashFiles(env.test-db-path) }}-' \ /repos/${{ github.repository }}/actions/caches)" >> $GITHUB_OUTPUT - name: Checking for cached magisk apk id: get-magisk-cache