2022-06-01 04:54:06 +02:00
|
|
|
name: Cache dependencies
|
|
|
|
inputs:
|
|
|
|
platform:
|
|
|
|
required: true
|
|
|
|
target:
|
|
|
|
required: true
|
|
|
|
bits:
|
|
|
|
required: true
|
|
|
|
outputs:
|
|
|
|
cache-hit:
|
|
|
|
value: ${{ steps.cache.outputs.cache-hit }}
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Hash submodule revisions
|
|
|
|
id: hash
|
|
|
|
working-directory: addons/godot_xterm/native/thirdparty
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-22 07:06:28 +02:00
|
|
|
cache_version=1 # Increment this number to invalidate the cache.
|
2022-06-01 04:54:06 +02:00
|
|
|
godot_cpp_rev=$(git ls-tree HEAD godot-cpp --object-only)
|
|
|
|
libuv_rev=$(git ls-tree HEAD libuv --object-only)
|
|
|
|
libtsm_rev=$(git ls-tree HEAD libtsm --object-only)
|
|
|
|
hash_cmd=$([[ $RUNNER_OS == 'Windows' ]] && echo 'sha1sum' || echo 'shasum')
|
2022-08-22 07:06:28 +02:00
|
|
|
hash_of_hashes=$(echo -n "$godot_cpp_rev$libuv_rev$libtsm_rev$cache_version" | $hash_cmd | head -c 40)
|
2022-06-01 04:54:06 +02:00
|
|
|
echo "::set-output name=hash::$hash_of_hashes"
|
|
|
|
- name: Cache submodules
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: addons/godot_xterm/native/thirdparty
|
|
|
|
key: thirdparty-${{ inputs.platform }}-${{ inputs.bits }}-${{ inputs.target }}-${{ steps.hash.outputs.hash }}
|