mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-13 23:05:31 +02:00
Update build files and GitHub Actions workflow
This commit is contained in:
parent
237a456f99
commit
2ba480b4da
15 changed files with 172 additions and 429 deletions
32
.github/actions/cache-submodules/action.yaml
vendored
32
.github/actions/cache-submodules/action.yaml
vendored
|
@ -1,32 +0,0 @@
|
|||
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: |
|
||||
cache_version=1 # Increment this number to invalidate the cache.
|
||||
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$cache_version" | $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 }}
|
44
.github/actions/cache-submodules/action.yml
vendored
Normal file
44
.github/actions/cache-submodules/action.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: Cache dependencies
|
||||
inputs:
|
||||
platform:
|
||||
required: true
|
||||
target:
|
||||
required: true
|
||||
arch:
|
||||
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 "hash=$hash_of_hashes" >> $GITHUB_OUTPUT
|
||||
build_files_hash=${{ hashFiles('**/build.sh', '**/*.Dockerfile', '**/SConstruct', '**/*.yml') }}
|
||||
echo "build-files-hash=$build_files_hash" >> $GITHUB_OUTPUT
|
||||
- name: Cache submodules
|
||||
uses: actions/cache@v3
|
||||
id: cache
|
||||
with:
|
||||
path: addons/godot_xterm/native/thirdparty
|
||||
key: thirdparty-${{ inputs.platform }}-${{ inputs.arch }}-${{ inputs.target }}-${{ steps.hash.outputs.hash }}-${{ steps.hash.outputs.build-files-hash }}
|
||||
restore-keys: |
|
||||
thirdparty-${{ inputs.platform }}-${{ inputs.arch }}-${{ inputs.target }}-${{ steps.hash.outputs.hash }}-
|
||||
thirdparty-${{ inputs.platform }}-${{ inputs.arch }}-${{ inputs.target }}-
|
||||
- name: Scons cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "${{github.workspace}}/.scons-cache/"
|
||||
key: scons-${{ inputs.platform }}-${{ inputs.arch }}-${{ inputs.target }}-${{ steps.hash.outputs.hash }}-${{ steps.hash.outputs.build-files-hash }}
|
||||
restore-keys: |
|
||||
scons-${{ inputs.platform }}-${{ inputs.arch }}-${{ inputs.target }}-${{ steps.hash.outputs.hash }}-
|
||||
scons-${{ inputs.platform }}-${{ inputs.arch }}-${{ inputs.target }}-
|
10
.github/actions/import-assets/action.yml
vendored
Normal file
10
.github/actions/import-assets/action.yml
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
name: Import assets
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Import assets
|
||||
shell: bash
|
||||
run: |
|
||||
# HACK: See https://github.com/godotengine/godot-proposals/issues/1362.
|
||||
(for i in {1..4}; do godot --editor --headless & sleep 5 && .github/actions/import-assets/monitor_import.sh; done) || true
|
||||
|
10
.github/actions/import-assets/monitor_import.sh
vendored
Executable file
10
.github/actions/import-assets/monitor_import.sh
vendored
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Source: https://github.com/godotengine/godot/pull/68461#issuecomment-1328177902
|
||||
|
||||
while [ "$(printf "%.0f\n" $(top -n 1 -b | awk '/^%Cpu/{print $2}'))" -gt 10 ];
|
||||
do
|
||||
echo "$(top -n 1 -b | awk '/^%Cpu/{print $2}')";
|
||||
done
|
||||
echo "Finished importing. Killing godot editor process";
|
||||
kill -9 $(pgrep -o godot)
|
Loading…
Add table
Add a link
Reference in a new issue