Files
Pascal Roeleven d53896f952 Use actions/cache lookup-only instead of custom action
Now that the lookup-only option is available, we should use this instead
2023-03-09 19:57:00 +01:00

54 lines
1.5 KiB
YAML

name: Preload img cache
inputs:
cache-key-prefix:
description: 'Device cache-key prefix'
required: true
device:
description: 'Device name'
required: true
runs:
using: "composite"
steps:
- uses: actions/cache@v3
id: cache-img
with:
key: ${{ inputs.cache-key-prefix }}${{ inputs.device }}
# Make sure any changes to path are also reflected in ci.yml setup
path: tests/files/${{ inputs.device }}-sparse.tar
- if: ${{ steps.cache-img.outputs.cache-hit }}
name: Extracting image from sparse archive
shell: sh
run: |
tar -C tests/files -xf tests/files/${{ inputs.device }}-sparse.tar
- if: ${{ ! steps.cache-img.outputs.cache-hit }}
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: python3-lz4 python3-protobuf
- if: ${{ ! steps.cache-img.outputs.cache-hit }}
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: python3-strictyaml
- name: Downloading device image for ${{ inputs.device }}
if: ${{ ! steps.cache-img.outputs.cache-hit }}
shell: sh
run: |
./tests/tests.py \
download \
--stripped \
--no-magisk \
--device \
${{ inputs.device }}
- if: ${{ ! steps.cache-img.outputs.cache-hit }}
name: Creating sparse archive from image
shell: sh
run: |
cd tests/files
tar --sparse -cf ${{ inputs.device }}-sparse.tar \
${{ inputs.device }}/*.stripped