Use sparse images in GA

Also invalidate caches by adding version prefix
This commit is contained in:
Pascal Roeleven
2023-03-02 15:02:22 +01:00
parent 632cbeecaa
commit 9dec3f8408
2 changed files with 13 additions and 3 deletions
+12 -2
View File
@@ -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 }}
+1 -1
View File
@@ -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