diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..9fcd4cf --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +# Gitea Actions is GitHub-Actions-compatible: drop this in .gitea/workflows/, enable Actions on the +# repo ([actions] ENABLED=true in app.ini, Gitea >= 1.19) and register an act_runner — it then runs +# on every push / PR just like the GitHub workflow. This mirrors .github/workflows/ci.yml but installs +# Godot and gdtoolkit with plain shell steps instead of the chickensoft setup-godot action, because a +# self-hosted runner usually can't reach the GitHub action registry (unless DEFAULT_ACTIONS_URL is set +# to proxy github.com). Only actions/checkout and actions/upload-artifact remain as external actions — +# both ship with Gitea's default proxy; if yours is offline, mirror them into your instance. + +on: + push: + pull_request: + +env: + # The Godot build the team runs (godot --version -> 4.7.beta.custom_build.417cd33bf). Pin this to a + # PUBLISHED build from https://github.com/godotengine/godot-builds/releases. If you run a custom + # build with no public binary, host the linux headless zip where the runner can reach it and set + # GODOT_URL to that (it overrides the constructed URL below). + GODOT_VERSION: "4.7-beta1" + GODOT_URL: "" + +jobs: + test: + name: Lint & headless tests + runs-on: ubuntu-latest # must match a label your act_runner registered with + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Godot ${{ env.GODOT_VERSION }} + run: | + set -eux + url="${GODOT_URL:-https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_linux.x86_64.zip}" + curl -fL "$url" -o /tmp/godot.zip + unzip -o /tmp/godot.zip -d /tmp/godot + install -m 755 /tmp/godot/Godot_v*_linux.x86_64 /usr/local/bin/godot + godot --version + + - name: Install gdlint (gdtoolkit) + # A venv sidesteps PEP-668 "externally managed" pip on recent runner images; putting its bin on + # GITHUB_PATH lets run_tests.sh call bare `gdlint` in later steps. + run: | + set -eux + python3 -m venv /tmp/venv + /tmp/venv/bin/pip install "gdtoolkit==4.*" + echo "/tmp/venv/bin" >> "$GITHUB_PATH" + + # First run imports assets and builds the .godot cache (gitignored) so headless tests can load + # the .glb/.png resources they instance. Import can exit non-zero on warnings. + - name: Import resources + run: godot --headless --import + continue-on-error: true + + - name: gdlint + run: gdlint *.gd levels/*.gd tests/*.gd + + - name: Headless tests + env: + GODOT: godot + run: bash run_tests.sh --no-gameplay + + - name: Upload test output on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-output + path: tests/output/ + if-no-files-found: ignore