-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
833: Feature flag for custom Godot version r=Bromeon a=Bromeon Enables the use of custom Godot builds in a straightforward way. This includes older versions such as Godot 3.2, for which `api.json` is no longer shipped along. Previous process (see also [book](https://godot-rust.github.io/book/advanced-guides/custom-godot.html)): * create a local copy of godot-rust * Run `godot --gdnative-generate-json-api` * replace `api.json` inside `gdnative-binding` New process: * enable feature `custom-godot` * make sure `godot` executable is in path **OR** set `GODOT_BIN` env var * done This supersedes the previous `bindings` feature, which is now removed. I also added CI support for previous Godot version 3.3.1, so far only for integration tests. Originally I wanted to use Godot 3.2 (the oldest supported version), however godotengine/godot#36582 prevented headless versions from generating `api.json` reliably without crashing. This has been fixed for versions >= 3.3.1. There is still testing to be done; feedback is always appreciated! 🙂 Closes #640. Thanks for the great ideas in that issue. Co-authored-by: Jan Haller <bromeon@gmail.com>
- Loading branch information
Showing
19 changed files
with
284 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: godot | ||
description: "Run Godot integration tests" | ||
|
||
inputs: | ||
godot_ver: | ||
required: true | ||
description: "Godot version (e.g. '3.2')" | ||
|
||
rust_toolchain: | ||
required: false | ||
default: 'stable' | ||
description: "Rust toolchain specifier (e.g. 'nightly')" | ||
|
||
rust_extra_args: | ||
required: false | ||
default: '' | ||
description: "Extra command line arguments for 'cargo build', e.g. features" | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Rust | ||
uses: ./.github/composite/rust | ||
with: | ||
rust: ${{ inputs.rust_toolchain }} | ||
- name: "Check cache for installed Godot version" | ||
id: "cache-godot" | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ runner.temp }}/godot_bin | ||
key: godot-${{ runner.os }}-v${{ inputs.godot_ver }} | ||
- name: "Install Godot" | ||
if: steps.cache-godot.outputs.cache-hit != 'true' | ||
run: | | ||
wget --no-verbose "https://downloads.tuxfamily.org/godotengine/${{ inputs.godot_ver }}/Godot_v${{ inputs.godot_ver }}-stable_linux_headless.64.zip" -O /tmp/godot.zip | ||
unzip -o /tmp/godot.zip -d ${{ runner.temp }}/godot_bin | ||
shell: bash | ||
- name: "Set environment variable" | ||
run: | | ||
echo "GODOT_BIN=${{ runner.temp }}/godot_bin/Godot_v${{ inputs.godot_ver }}-stable_linux_headless.64" >> $GITHUB_ENV | ||
shell: bash | ||
- name: "Build godot-rust" | ||
run: | | ||
echo "File size of api.json -- before:" | ||
stat -c %s gdnative-bindings/api.json | ||
#echo "CRC32 of api.json: " | ||
#crc32 gdnative-bindings/api.json | ||
cd test | ||
cargo build ${{ inputs.rust_extra_args }} | ||
cd .. | ||
echo "File size of api.json -- after:" | ||
stat -c %s gdnative-bindings/api.json | ||
shell: bash | ||
- name: "Run Godot integration tests" | ||
run: | | ||
cd test; | ||
mkdir -p ./project/lib; | ||
cp ../target/debug/libgdnative_test.so ./project/lib/; | ||
${GODOT_BIN} --path ./project/ > >(tee "${{ runner.temp }}/stdout.log"); | ||
if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then | ||
exit 1; | ||
fi; | ||
${GODOT_BIN} -e --path ./project/ --run-editor-tests > >(tee "${{ runner.temp }}/stdout.log"); | ||
if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then | ||
exit 1; | ||
fi; | ||
cargo build --features type-tag-fallback; | ||
mkdir -p ./project/lib; | ||
cp ../target/debug/libgdnative_test.so ./project/lib/; | ||
${GODOT_BIN} --path ./project/ > >(tee "${{ runner.temp }}/stdout.log"); | ||
if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then | ||
exit 1; | ||
fi; | ||
${GODOT_BIN} -e --path ./project/ --run-editor-tests > >(tee "${{ runner.temp }}/stdout.log"); | ||
if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then | ||
exit 1; | ||
fi; | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.