name: CI on: push: branches: [develop, main] pull_request: branches: [develop, main] jobs: validate-data: name: Validate JSON data files runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Check JSON syntax run: | find data -name "*.json" | while read f; do python3 -m json.tool "$f" > /dev/null && echo "OK: $f" || { echo "FAIL: $f"; exit 1; } done unit-tests: name: Run GUT tests runs-on: ubuntu-latest needs: validate-data steps: - uses: actions/checkout@v4 - name: Install Godot 4 run: | wget -q https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_linux.x86_64.zip unzip -q Godot_v4.3-stable_linux.x86_64.zip chmod +x Godot_v4.3-stable_linux.x86_64 sudo mv Godot_v4.3-stable_linux.x86_64 /usr/local/bin/godot - name: Run GUT tests run: | godot --headless --path . -s addons/gut/gut_cmdln.gd \ -gdir=res://tests/ -gexit export-web: name: Export HTML5 build runs-on: ubuntu-latest needs: unit-tests if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 - name: Install Godot + export templates run: | wget -q https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_linux.x86_64.zip unzip -q Godot_v4.3-stable_linux.x86_64.zip sudo mv Godot_v4.3-stable_linux.x86_64 /usr/local/bin/godot mkdir -p ~/.local/share/godot/export_templates/4.3.stable wget -q https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_export_templates.tpz unzip -q Godot_v4.3-stable_export_templates.tpz -d /tmp/templates mv /tmp/templates/templates/* ~/.local/share/godot/export_templates/4.3.stable/ - name: Export HTML5 run: | mkdir -p build/web godot --headless --export-release "Web" build/web/index.html - name: Upload build artifact uses: actions/upload-artifact@v4 with: name: web-build path: build/web/