mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-08 05:15:30 +02:00
Extract submodule cache steps to compound action
Creates a reusable action for caching submodules in the thirdparty directory.
This commit is contained in:
parent
1d51acb38d
commit
5108c7cabd
2 changed files with 43 additions and 31 deletions
34
.github/actions/cache-submodules/action.yaml
vendored
Normal file
34
.github/actions/cache-submodules/action.yaml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
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: |
|
||||
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')
|
||||
hash_of_hashes=$(echo -n "$godot_cpp_rev$libuv_rev$libtsm_rev" | $hash_cmd | head -c 40)
|
||||
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 }}
|
||||
restore-keys: |
|
||||
thirdparty-${{ inputs.platform }}-${{ inputs.bits }}-${{ inputs.target }}-
|
||||
thirdparty-${{ inputs.platform }}-${{ inputs.bits }}-
|
Loading…
Add table
Add a link
Reference in a new issue