Fix smoke test: Extract engine to workspace, put SpringBoard in games/ #10
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 "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 | |
| - 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 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=$? | |
| # Exit codes: | |
| # 0 = clean exit (unlikely in 10s) | |
| # 124 = timeout (expected - means it ran without crashing) | |
| # Other = crash/error | |
| echo "" | |
| echo "=== Checking for RmlUi initialization in logs ===" | |
| if [ -f test-data/infolog.txt ]; then | |
| if grep -i "rmlui" test-data/infolog.txt; then | |
| echo "✓ RmlUi messages found in infolog" | |
| else | |
| echo "⚠ No RmlUi messages found in infolog" | |
| fi | |
| if grep -i "luaui.*loaded\|loading luaui" test-data/infolog.txt; then | |
| echo "✓ LuaUI loaded successfully" | |
| else | |
| echo "⚠ Could not confirm LuaUI loaded" | |
| fi | |
| fi | |
| echo "" | |
| if [ "${EXIT_CODE:-0}" -eq 124 ]; then | |
| echo "✓ SpringBoard started successfully and ran for 10 seconds" | |
| echo "✓ Smoke test PASSED (with LuaUI + RmlUi)" | |
| exit 0 | |
| elif [ "${EXIT_CODE:-0}" -eq 0 ]; then | |
| echo "✓ SpringBoard exited cleanly" | |
| echo "✓ Smoke test PASSED" | |
| exit 0 | |
| else | |
| echo "✗ SpringBoard crashed with exit code: ${EXIT_CODE}" | |
| echo "✗ Smoke test FAILED" | |
| # Show infolog if available | |
| if [ -f test-data/infolog.txt ]; then | |
| echo "=== Last 100 lines of infolog.txt ===" | |
| tail -100 test-data/infolog.txt | |
| fi | |
| 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 |