diff --git a/.github/workflows/playgodot-integration.yml b/.github/workflows/playgodot-integration.yml new file mode 100644 index 000000000000..5c8e3dbb7340 --- /dev/null +++ b/.github/workflows/playgodot-integration.yml @@ -0,0 +1,100 @@ +# Run PlayGodot integration tests against the automation build +# This validates that the automation protocol works correctly + +name: PlayGodot Integration Tests + +on: + workflow_run: + workflows: ["🔗 GHA"] + types: [completed] + branches: [automation] + workflow_dispatch: + +jobs: + test-integration: + # Only run if the build succeeded + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-22.04 + name: PlayGodot Integration Tests + + steps: + - name: Download Godot artifact + uses: dawidd6/action-download-artifact@v6 + with: + workflow: runner.yml + workflow_conclusion: success + name: linux-editor-mono + path: godot-bin + # Use run_id from the triggering workflow, or latest for manual trigger + run_id: ${{ github.event.workflow_run.id }} + if_no_artifact_found: warn + + - name: Fallback - Download from latest successful run + if: failure() || hashFiles('godot-bin/godot.*') == '' + uses: dawidd6/action-download-artifact@v6 + with: + workflow: runner.yml + workflow_conclusion: success + name: linux-editor-mono + path: godot-bin + search_artifacts: true + + - name: Setup Godot + run: | + ls -la godot-bin/ || echo "No godot-bin directory" + chmod +x godot-bin/godot.* || true + + # Find the godot binary + GODOT_BIN=$(find godot-bin -name 'godot.*' -type f | head -1) + if [ -z "$GODOT_BIN" ]; then + echo "No Godot binary found, skipping tests" + exit 0 + fi + + sudo mv "$GODOT_BIN" /usr/local/bin/godot + godot --version + + - name: Install display dependencies + run: | + sudo apt-get update + sudo apt-get install -y xvfb + + - name: Checkout PlayGodot + uses: actions/checkout@v4 + with: + repository: Randroids-Dojo/PlayGodot + path: playgodot + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install PlayGodot + run: | + cd playgodot/python + pip install -e ".[dev]" + + - name: Run unit tests + run: | + cd playgodot/python + pytest tests/ -v --tb=short + + - name: Run tic-tac-toe integration tests + run: | + cd playgodot/examples/tic-tac-toe + # Run with xvfb for headless display + xvfb-run -a pytest tests/ -v --tb=short + env: + GODOT_PATH: /usr/local/bin/godot + + - name: Test results summary + if: always() + run: | + echo "## PlayGodot Integration Test Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + if [ "${{ job.status }}" == "success" ]; then + echo "✅ All integration tests passed!" >> $GITHUB_STEP_SUMMARY + else + echo "❌ Some tests failed. Check the logs above for details." >> $GITHUB_STEP_SUMMARY + fi