Skip to content

Commit

Permalink
+x
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Dec 5, 2023
1 parent 7bde398 commit 70fbf77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/other/check-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ fi
dir="examples/$example/godot"
logfile="stderr-$example.log"

# In .gdextension file, use paths to release artifacts.
sed -i'.bak' "s!/debug/!/release/!g" "$dir/rust.gdextension"

echo "Godot binary: $GODOT4_BIN"

# Could also use `timeout -s9`, but there were some issues and this gives more control.
$GODOT4_BIN --headless --path "$dir" 2> "$logfile" &
pid=$!

Expand All @@ -30,20 +35,13 @@ echo "Terminate Godot process $pid..."
kill $pid
wait $pid || true

# Alternative:
# $GODOT4_BIN ... &
# pid=$!
# sleep 2
# kill -9 $pid
# wait $pid 2>/dev/null

echo "Output in stderr:"
echo "----------------------------------------------------"
cat "$logfile"
echo "----------------------------------------------------"

if grep "ERROR:" "$logfile"; then
echo "::error::Godot engine encountered error while running example '$example'."
if grep --quiet "ERROR:" "$logfile"; then
echo "::error::Godot engine encountered errors while running example '$example'."
exit 1
fi

Expand Down

0 comments on commit 70fbf77

Please sign in to comment.