Skip to content

Commit

Permalink
CI: on Windows, use taskkill instead of pkill to abort Godot
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Feb 16, 2025
1 parent c31098f commit a8fccb3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/composite/godot-itest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ runs:
# * tee: still output logs while scanning for errors
# * grep -q: no output, use exit code 0 if found -> thus also &&
# * pkill: stop Godot execution (since it hangs in headless mode); simple 'head -1' did not work as expected
# since it's not available on Windows, use taskkill in that case.
# * exit: the terminated process would return 143, but this is more explicit and future-proof
#
# --disallow-focus: fail if #[itest(focus)] is encountered, to prevent running only a few tests for full CI
Expand All @@ -166,10 +167,14 @@ runs:
$GODOT4_BIN --headless -- --disallow-focus ${{ inputs.godot-args }} 2>&1 \
| tee "${{ runner.temp }}/log.txt" \
| tee >(grep -E "SCRIPT ERROR:|Can't open dynamic library" -q && {
printf "\n::error::godot-itest: unrecoverable Godot error, abort...\n";
pkill godot
echo "OUTCOME=godot-runtime" >> $GITHUB_ENV
exit 2
printf "\n::error::godot-itest: unrecoverable Godot error, abort...\n";
if [[ "$RUNNER_OS" == "Windows" ]]; then
taskkill -f -im godot*
else
pkill godot
fi
echo "OUTCOME=godot-runtime" >> $GITHUB_ENV
exit 2
})
echo "OUTCOME=success" >> $GITHUB_ENV
Expand Down Expand Up @@ -198,14 +203,14 @@ runs:
"godot-runtime")
echo "### :x: Godot runtime error" > $GITHUB_STEP_SUMMARY
echo "$GODOT_BUILT_FROM" >> $GITHUB_STEP_SUMMARY
echo "Aborted due to an error during Godot execution." >> $GITHUB_STEP_SUMMARY
echo "Aborted due to an error during Godot execution." >> $GITHUB_STEP_SUMMARY
exit 2
;;
"godot-leak")
echo "### :x: Memory leak" > $GITHUB_STEP_SUMMARY
echo "$GODOT_BUILT_FROM" >> $GITHUB_STEP_SUMMARY
echo "Integration tests cause memory leaks." >> $GITHUB_STEP_SUMMARY
echo "Integration tests cause memory leaks." >> $GITHUB_STEP_SUMMARY
exit 3
;;
Expand Down

0 comments on commit a8fccb3

Please sign in to comment.