Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
010e5d5061 | ||
|
|
b586447a4d |
@@ -23,10 +23,13 @@ jobs:
|
||||
|
||||
- name: Import
|
||||
working-directory: source_godot
|
||||
run: godot --version && godot --headless --path . --import
|
||||
timeout-minutes: 5
|
||||
run: godot --version && timeout -k 10 180 godot --headless --path . --import
|
||||
|
||||
- name: Tests and balance bot (in parallel; a tag skips them if this commit already passed on main)
|
||||
working-directory: source_godot
|
||||
# backstop only: every Godot process below has its own timeout, so a hang fails with its log instead of this
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
@@ -41,8 +44,9 @@ jobs:
|
||||
esac
|
||||
# every Godot process gets its own user:// (XDG_DATA_HOME), because the tests reuse save file names
|
||||
L=/tmp/ci; mkdir -p $L
|
||||
run() { n=$1; shift; (env XDG_DATA_HOME=$L/u_$n "$@" > $L/$n.log 2>&1; echo $? > $L/$n.rc) & }
|
||||
run tests env GODOT=godot sh run_tests.sh
|
||||
# a hung process is killed after 4 min (exit 124/137) and reported below with its log tail
|
||||
run() { n=$1; shift; (env XDG_DATA_HOME=$L/u_$n timeout -k 10 240 "$@" > $L/$n.log 2>&1; echo $? > $L/$n.rc) & }
|
||||
run tests env GODOT=godot TEST_TIMEOUT=180 sh run_tests.sh
|
||||
# balance bot: seed:difficulty (0 novice, 1 normal, 2 paranoid):choices in the Act IV, V and VI finals
|
||||
for c in 1:1:222 8:1:111 3:1:221 4:0:112 5:2:222 7:2:111; do
|
||||
s=$(echo $c | cut -d: -f1); d=$(echo $c | cut -d: -f2); ch=$(echo $c | cut -d: -f3)
|
||||
@@ -55,7 +59,7 @@ jobs:
|
||||
s=${c%%:*}
|
||||
echo "seed $c: $(grep -E '^(НЕСКІНЧЕННА|КІНЕЦЬ|OK|FAIL)' $L/bal_$s.log | tr '\n' ' ')"
|
||||
done
|
||||
for r in $L/*.rc; do [ "$(cat $r)" = 0 ] || { fail=1; echo "FAILED: $(basename $r .rc)"; cat ${r%.rc}.log | tail -30; }; done
|
||||
for r in $L/*.rc; do rc=$(cat $r); [ "$rc" = 0 ] || { fail=1; case $rc in 124|137) echo "HUNG (killed by timeout): $(basename $r .rc)";; *) echo "FAILED ($rc): $(basename $r .rc)";; esac; tail -30 ${r%.rc}.log; }; done
|
||||
exit $fail
|
||||
|
||||
- name: Export Windows exe
|
||||
|
||||
BIN
game_godot/TinMerezhi.exe
(Stored with Git LFS)
BIN
game_godot/TinMerezhi.exe
(Stored with Git LFS)
Binary file not shown.
@@ -2,10 +2,14 @@
|
||||
# Усі автотести гри одним запуском: GODOT=/шлях/до/godot ./run_tests.sh
|
||||
cd "$(dirname "$0")"
|
||||
G="${GODOT:-godot}"
|
||||
# завислий тест падає за TEST_TIMEOUT секунд і називає себе (timeout із coreutils; якщо його нема, запуск без ліміту)
|
||||
T=""; command -v timeout >/dev/null 2>&1 && T="timeout -k 10 ${TEST_TIMEOUT:-180}"
|
||||
fail=0
|
||||
for t in smoke fx balance update features lang; do
|
||||
echo "=== $t"
|
||||
"$G" --headless --path . -s "tests/$t.gd" || fail=1
|
||||
$T "$G" --headless --path . -s "tests/$t.gd"; rc=$?
|
||||
[ $rc = 124 ] || [ $rc = 137 ] && echo "ЗАВИС: tests/$t.gd не завершився за ${TEST_TIMEOUT:-180} с"
|
||||
[ $rc = 0 ] || fail=1
|
||||
done
|
||||
[ $fail = 0 ] && echo "УСІ ТЕСТИ ПРОЙШЛИ" || echo "Є ПОМИЛКИ"
|
||||
exit $fail
|
||||
|
||||
@@ -265,8 +265,10 @@ static func build(g) -> void:
|
||||
gen.buffer_length = 0.2
|
||||
player.stream = gen
|
||||
g.add_child(player)
|
||||
player.play()
|
||||
g.playback = player.get_stream_playback()
|
||||
# headless (тести, CI): без генератора — звуковий потік Godot зрідка зациклювався на ньому під навантаженням і вішав тест
|
||||
if DisplayServer.get_name() != "headless":
|
||||
player.play()
|
||||
g.playback = player.get_stream_playback()
|
||||
g.sfx_player = player
|
||||
g.music_player = AudioStreamPlayer.new()
|
||||
g.add_child(g.music_player)
|
||||
|
||||
Reference in New Issue
Block a user