Skip to content

windowstead #79: Add macOS validation to pull-request CI #82

windowstead #79: Add macOS validation to pull-request CI

windowstead #79: Add macOS validation to pull-request CI #82

Workflow file for this run

name: Test
on:
pull_request:
permissions:
contents: read
env:
GODOT_VERSION: 4.2.2
GODOT_STATUS: stable
GODOT_LINUX_URL: https://github.com/godotengine/godot-builds/releases/download/4.2.2-stable/Godot_v4.2.2-stable_linux.x86_64.zip
jobs:
smoke-test:
name: Headless smoke test
runs-on: [windowstead, linux, x64]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools
curl -fsSL "$GODOT_LINUX_URL" -o /tmp/godot_linux.zip
unzip -oq /tmp/godot_linux.zip -d .tools/
chmod +x .tools/Godot_v4.2.2-stable_linux.x86_64
- name: Verify Godot binary
shell: bash
run: |
set -euo pipefail
chmod +x .tools/Godot_v4.2.2-stable_linux.x86_64
./.tools/Godot_v4.2.2-stable_linux.x86_64 --version
- name: Run headless smoke test
shell: bash
run: |
set -euo pipefail
timeout 15 ./.tools/Godot_v4.2.2-stable_linux.x86_64 --headless --path . --fixed-fps 60 --quit-after 300 > smoke.log 2>&1
if grep -E "SCRIPT ERROR|ERROR:" smoke.log; then
echo "Smoke test logged an engine/script error" >&2
cat smoke.log >&2
exit 1
fi
script-tests:
name: Script test suite
runs-on: [windowstead, linux, x64]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools
curl -fsSL "$GODOT_LINUX_URL" -o /tmp/godot_linux.zip
unzip -oq /tmp/godot_linux.zip -d .tools/
chmod +x .tools/Godot_v4.2.2-stable_linux.x86_64
- name: Run script tests
shell: bash
run: |
set -euo pipefail
./.tools/Godot_v4.2.2-stable_linux.x86_64 --headless --path . --script res://tests/test_runner.gd > tests.log 2>&1
TEST_EXIT=$?
cat tests.log
# Print structured summary for CI
if [ $TEST_EXIT -ne 0 ]; then
echo "::error::Script tests failed (exit code $TEST_EXIT)"
exit 1
fi
PASS_COUNT=$(grep -c ": PASS" tests.log || true)
FAIL_COUNT=$(grep -c ": FAIL" tests.log || true)
echo "test_runner: $PASS_COUNT passed, $FAIL_COUNT failed"
- name: Run E2E gameplay flow tests
shell: bash
run: |
set -euo pipefail
./.tools/Godot_v4.2.2-stable_linux.x86_64 --headless --path . --script res://tests/test_e2e.gd > e2e-tests.log 2>&1
cat e2e-tests.log
macos-validation:
name: macOS validation
runs-on: [windowstead, macos, arm64]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools/macos
curl -fsSL "https://github.com/godotengine/godot-builds/releases/download/4.2.2-stable/Godot_v4.2.2-stable_macos.universal.zip" -o /tmp/godot_macos.zip
unzip -oq /tmp/godot_macos.zip -d .tools/macos
GODOT_MAC_APP=$(find .tools/macos -maxdepth 2 -name 'Godot.app' -print -quit)
if [ -z "$GODOT_MAC_APP" ]; then
echo "::error::Godot.app not found after unzip"
find .tools/macos -maxdepth 3 -print
exit 1
fi
echo "GODOT_MAC_APP=$GODOT_MAC_APP" >> "$GITHUB_ENV"
chmod +x "$GODOT_MAC_APP/Contents/MacOS/Godot"
- name: Verify Godot binary
shell: bash
run: |
set -euo pipefail
"$GODOT_MAC_APP/Contents/MacOS/Godot" --version
- name: Run headless smoke test
shell: bash
run: |
set -euo pipefail
timeout 15 "$GODOT_MAC_APP/Contents/MacOS/Godot" --headless --path . --fixed-fps 60 --quit-after 300 > smoke.log 2>&1
if grep -E "SCRIPT ERROR|ERROR:" smoke.log; then
echo "Smoke test logged an engine/script error" >&2
cat smoke.log >&2
exit 1
fi
- name: Run script tests
shell: bash
run: |
set -euo pipefail
"$GODOT_MAC_APP/Contents/MacOS/Godot" --headless --path . --script res://tests/test_runner.gd > tests.log 2>&1
TEST_EXIT=$?
cat tests.log
if [ $TEST_EXIT -ne 0 ]; then
echo "::error::Script tests failed (exit code $TEST_EXIT)"
exit 1
fi
PASS_COUNT=$(grep -c ": PASS" tests.log || true)
FAIL_COUNT=$(grep -c ": FAIL" tests.log || true)
echo "test_runner: $PASS_COUNT passed, $FAIL_COUNT failed"