chore: ignorar carpetas en el attributes #5
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: CI | |
| # Runs the four manifest gates on every push to main and every PR: | |
| # 1. compile gate — every engine .gd parses/type-checks (tools/check_scripts.gd) | |
| # 2. unit tests — the GUT suite under test/ (0 tests or a skipped script fails) | |
| # 3. leak gate — benchmark's portable ObjectDB-leak detector | |
| # 4. lint gate — gdlint over addons/card_combat (.gdlintrc config) | |
| # The benchmark's µs figures are hardware-specific and NOT asserted here; only its | |
| # leak detector (exit 1 on a reference cycle) is portable, so CI runs it with a | |
| # small combat count for speed. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| env: | |
| GODOT_VERSION: "4.6" | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Cache the extracted binary keyed by version so a re-run skips the download. | |
| - name: Cache Godot binary | |
| id: cache-godot | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/godot-bin | |
| key: godot-${{ env.GODOT_VERSION }}-stable-linux | |
| - name: Install Godot ${{ env.GODOT_VERSION }} | |
| if: steps.cache-godot.outputs.cache-hit != 'true' | |
| run: | | |
| set -euo pipefail | |
| BASE="Godot_v${GODOT_VERSION}-stable_linux.x86_64" | |
| URL="https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/${BASE}.zip" | |
| mkdir -p ~/godot-bin | |
| curl -fsSL "$URL" -o /tmp/godot.zip | |
| unzip -o /tmp/godot.zip -d ~/godot-bin | |
| mv ~/godot-bin/${BASE} ~/godot-bin/godot | |
| chmod +x ~/godot-bin/godot | |
| - name: Add Godot to PATH | |
| run: echo "$HOME/godot-bin" >> "$GITHUB_PATH" | |
| # First headless run generates the .godot import cache (icon, etc.); without it | |
| # GUT can fail to load resources. Import errors must surface, so no `|| true`. | |
| - name: Import resources | |
| run: godot --headless --path . --import | |
| - name: Compile gate | |
| run: godot --headless --path . --script addons/card_combat/tools/check_scripts.gd | |
| # GUT's exit code alone cannot be trusted: it exits 0 both when it collects | |
| # ZERO tests ("Nothing was run") and when a test script fails to parse (it | |
| # skips the whole file and reports the remaining tests green). Both verified | |
| # empirically on GUT 9.6. So the step also fails on an empty run and on any | |
| # skipped/unloadable test script — 0 tests is never a pass (repo rule). | |
| - name: Unit tests (GUT) | |
| run: | | |
| set -euo pipefail | |
| godot --headless --path . -s addons/gut/gut_cmdln.gd -gdir=res://test -ginclude_subdirs -gexit 2>&1 | tee /tmp/gut.log | |
| tests="$(awk '/^Tests/ {print $2; exit}' /tmp/gut.log)" | |
| if [ -z "${tests}" ] || [ "${tests}" -eq 0 ]; then | |
| echo "::error::GUT collected 0 tests — test collection is broken" | |
| exit 1 | |
| fi | |
| if grep -qE "Failed to load script|SCRIPT ERROR" /tmp/gut.log; then | |
| echo "::error::GUT skipped at least one test script that failed to load/parse" | |
| exit 1 | |
| fi | |
| echo "GUT ran ${tests} tests" | |
| - name: Leak gate (benchmark) | |
| run: godot --headless --path . --script addons/card_combat/benchmark/combat_benchmark.gd -- 40 | |
| # Complementary lint gate (manifest `lint` command): gdlint catches the | |
| # correctness/naming smells the headless compile gate cannot see. Config in | |
| # .gdlintrc at the repo root. | |
| - name: Lint gate (gdlint) | |
| run: | | |
| set -euo pipefail | |
| python3 -m pip install --quiet "gdtoolkit==4.*" | |
| gdlint addons/card_combat |