Fix YAML syntax: use \!= 'true' instead of == 'false' #16
This file contains hidden or 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
| name: Smoke Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'claude/**' | |
| pull_request: | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| smoke-test-linux: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'true' | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| wget \ | |
| p7zip-full \ | |
| xvfb \ | |
| libsdl2-2.0-0 \ | |
| libglew2.2 \ | |
| libopenal1 \ | |
| libcurl4 \ | |
| libgl1 \ | |
| libglu1-mesa | |
| - name: Download BAR Engine (with RmlUi support) | |
| run: | | |
| echo "Downloading BAR Engine 105.1.1-2472-ga5aa45c (supports RmlUi)..." | |
| wget -q "https://github.com/beyond-all-reason/spring/releases/download/spring_bar_%7BBAR105%7D105.1.1-2472-ga5aa45c/spring_bar_.BAR105.105.1.1-2472-ga5aa45c_linux-64-minimal-portable.7z" | |
| 7z x -y "spring_bar_.BAR105.105.1.1-2472-ga5aa45c_linux-64-minimal-portable.7z" | |
| rm *.7z | |
| chmod +x spring | |
| chmod +x spring-headless || true | |
| chmod +x spring-dedicated || true | |
| ls -lah | head -20 | |
| - name: Put SpringBoard in engine's games folder | |
| run: | | |
| # SpringBoard-Core is already a valid Spring archive | |
| # Just symlink it into the engine's games/ folder | |
| mkdir -p games | |
| ln -s "$(pwd)" "games/SpringBoard Core.sdd" | |
| ls -lah games/ | |
| - name: Download test map | |
| run: | | |
| mkdir -p maps | |
| cd maps | |
| echo "Downloading Comet Catcher Redux map for testing..." | |
| wget -q "http://springfiles.springrts.com/spring/spring-maps/Comet%20Catcher%20Redux%201.8.sd7" -O "Comet_Catcher_Redux_1.8.sd7" || { | |
| echo "Map download failed, will try to use generated blank map" | |
| } | |
| cd .. | |
| - name: Create Spring config to disable audio | |
| run: | | |
| # Create springsettings.cfg to disable audio (no sound card in CI) | |
| mkdir -p test-data | |
| cat > test-data/springsettings.cfg << 'EOF' | |
| snd_disable = 1 | |
| snd_volmaster = 0 | |
| snd_volgeneral = 0 | |
| snd_volunitreply = 0 | |
| snd_volbattle = 0 | |
| snd_volui = 0 | |
| EOF | |
| cat test-data/springsettings.cfg | |
| - name: Create Spring script.txt | |
| run: | | |
| # Try to use downloaded map, fallback to blank map | |
| if [ -f maps/Comet_Catcher_Redux_1.8.sd7 ]; then | |
| MAP_NAME="Comet Catcher Redux 1.8" | |
| echo "Using downloaded map: $MAP_NAME" | |
| cat > script.txt << 'SCRIPTEND' | |
| [GAME] | |
| { | |
| GameType=SpringBoard Core; | |
| MapName=Comet Catcher Redux 1.8; | |
| IsHost=1; | |
| MyPlayerName=TestPlayer; | |
| [MODOPTIONS] | |
| { | |
| MapSeed=42; | |
| } | |
| [PLAYER0] | |
| { | |
| Name=TestPlayer; | |
| Team=0; | |
| IsFromDemo=0; | |
| Spectator=1; | |
| } | |
| [TEAM0] | |
| { | |
| TeamLeader=0; | |
| AllyTeam=0; | |
| } | |
| [ALLYTEAM0] | |
| { | |
| } | |
| } | |
| SCRIPTEND | |
| else | |
| echo "Using generated blank map" | |
| cat > script.txt << 'SCRIPTEND' | |
| [GAME] | |
| { | |
| GameType=SpringBoard Core; | |
| MapName=sb_initial_blank_10x8; | |
| IsHost=1; | |
| MyPlayerName=TestPlayer; | |
| [MODOPTIONS] | |
| { | |
| MapSeed=42; | |
| new_map_x=10; | |
| new_map_y=8; | |
| } | |
| [PLAYER0] | |
| { | |
| Name=TestPlayer; | |
| Team=0; | |
| IsFromDemo=0; | |
| Spectator=1; | |
| } | |
| [TEAM0] | |
| { | |
| TeamLeader=0; | |
| AllyTeam=0; | |
| } | |
| [ALLYTEAM0] | |
| { | |
| } | |
| } | |
| SCRIPTEND | |
| fi | |
| echo "=== Script contents ===" | |
| cat script.txt | |
| echo "=======================" | |
| - name: Run smoke test with Xvfb (tests LuaUI + RmlUi) | |
| run: | | |
| echo "Starting SpringBoard smoke test with virtual display..." | |
| echo "Using Xvfb to run full spring binary (loads LuaUI + RmlUi)" | |
| # Run Spring with Xvfb (virtual X11 display) so LuaUI loads | |
| # This actually tests RmlUi initialization! | |
| timeout 10s xvfb-run -a -s "-screen 0 1024x768x24" \ | |
| ./spring --write-dir $(pwd)/test-data script.txt || EXIT_CODE=$? | |
| # Wait a moment for Spring to finish writing logs | |
| sleep 2 | |
| echo "" | |
| echo "=== Exit Code Analysis ===" | |
| echo "Spring exit code: ${EXIT_CODE:-0}" | |
| # Exit codes: | |
| # 0 = clean exit | |
| # 124 = timeout (expected - means it ran for 10s without crashing) | |
| # 134 = SIGABRT (6+128) - crash! | |
| # Other non-zero = various crashes | |
| echo "" | |
| echo "=== Validating Success Criteria ===" | |
| # Check if infolog exists | |
| if [ ! -f test-data/infolog.txt ]; then | |
| echo "✗ FAIL: No infolog.txt generated - Spring didn't start" | |
| exit 1 | |
| fi | |
| # Check for crash signatures in infolog | |
| if grep -q "CrashHandler.*Error.*Aborted\|CrashHandler.*Error.*Segmentation\|XIO.*fatal.*error\|terminate called without an active exception" test-data/infolog.txt; then | |
| echo "✗ FAIL: Spring crashed (found crash signature in infolog)" | |
| echo "" | |
| echo "=== Crash signatures found ===" | |
| grep -E "CrashHandler.*Error|XIO.*fatal|terminate called" test-data/infolog.txt || true | |
| echo "" | |
| echo "=== Last 100 lines of infolog.txt ===" | |
| tail -100 test-data/infolog.txt | |
| exit 1 | |
| fi | |
| # Check if LuaUI loaded | |
| if ! grep -q "LuaUI.*Loaded\|Loading LuaUI" test-data/infolog.txt; then | |
| echo "✗ FAIL: LuaUI did not load" | |
| echo "" | |
| echo "=== Last 100 lines of infolog.txt ===" | |
| tail -100 test-data/infolog.txt | |
| exit 1 | |
| fi | |
| echo "✓ LuaUI loaded successfully" | |
| # Check for RmlUi initialization (optional warning if missing) | |
| if grep -q -i "rmlui" test-data/infolog.txt; then | |
| echo "✓ RmlUi messages found in infolog" | |
| else | |
| echo "⚠ Warning: No RmlUi messages found (might not be fatal)" | |
| fi | |
| # Only accept exit codes 0 or 124 (timeout) | |
| if [ "${EXIT_CODE:-0}" -eq 124 ]; then | |
| echo "" | |
| echo "✓ SpringBoard ran for full 10 seconds without crashing" | |
| echo "✓ SMOKE TEST PASSED" | |
| exit 0 | |
| elif [ "${EXIT_CODE:-0}" -eq 0 ]; then | |
| echo "" | |
| echo "✓ SpringBoard exited cleanly" | |
| echo "✓ SMOKE TEST PASSED" | |
| exit 0 | |
| else | |
| echo "" | |
| echo "✗ FAIL: Spring exited with code ${EXIT_CODE} (expected 0 or 124)" | |
| echo "" | |
| echo "=== Last 100 lines of infolog.txt ===" | |
| tail -100 test-data/infolog.txt | |
| exit 1 | |
| fi | |
| - name: Upload test artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: smoke-test-logs | |
| path: | | |
| test-data/infolog.txt | |
| test-data/*.log | |
| if-no-files-found: ignore | |
| - name: Show engine info | |
| if: always() | |
| run: | | |
| echo "=== Engine information ===" | |
| ./spring --version || true | |
| echo "" | |
| echo "=== RmlUi check ===" | |
| if strings ./spring | grep -i rmlui; then | |
| echo "✓ RmlUi support detected in engine binary" | |
| else | |
| echo "⚠ Could not detect RmlUi in engine binary" | |
| fi | |
| echo "" | |
| echo "=== GL info ===" | |
| ldd ./spring | grep -i "gl\|sdl" || true |