Skip to content

Commit

Permalink
chore: rewrite github action
Browse files Browse the repository at this point in the history
Not sure why godot-tester moved to node, but now subprocesses don't log
anymore, so we don't get any test output. Also, it depends on parsing an
xml results file, which is never written to when imports/tests fail for
misc other reasons, making it un-debugable. Pulling and rewriting the
godot-html-export action to run gut tests - could probably just install
bababshka and run my bb tasks instead...

Also, i think the tests are failing to run b/c of missing assets - but
i'd like to see that output in CI somehow first
  • Loading branch information
russmatney committed Oct 3, 2023
1 parent 6463853 commit f37c835
Showing 1 changed file with 24 additions and 45 deletions.
69 changes: 24 additions & 45 deletions .github/workflows/gut_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: touch ./test_results.xml
- uses: croconut/godot-tester@v5.1
with:
# required
version: "4.1.1"
# the type of release of godot that the tests should be run with
# release_type: "rc2"

# the folder with your project.godot file in it
path: "."

# how long to spend importing assets before tests are run
import-time: "false"
# how long tests can run in seconds
test-timeout: "false"
# the ratio of tests that must pass for this action to pass
# e.g. 0.6 means 60% of your tests must pass
minimum-pass: "1.0"

# the directory containing Gut tests
test-dir: "res://test"

# instead of running GUT's command line tool, you can run a test scene if you have one
# set up a scene like in this repo --> located at /tester_GUT_v9.0.1/test/alt_mode/tests.tscn
# set up a script like in this repo --> located at /tester_GUT_v9.0.1/test/alt_mode/cli_test.gd
# ensure that the script exits on test completion
# uses relative path from your godot project directory
# direct-scene: "tester_GUT_v9.0.1/test/alt_mode/tests.tscn"
direct-scene: "false"

# default is false, set true to count asserts instead of tests
assert-check: "false"

# not checked by default, set to a number to limit the
# maximum amount of failed tests for a passing test suite
max-fails: 0

# default is GUTs default: 'res://.gutconfig.json'; set this to load a different config file
config-file: "res://.gutconfig.json"

# designate a custom url to download the godot binary from
# custom-godot-dl-url: ""

# relative path to the xml file to read / write GUT's results from, recommended
# for direct-scene users to check this file if you have issues
result-output-file: "test_results.xml"
- name: Cache Godot files
id: cache-godot
uses: actions/cache@v3
with:
path: |
~/.local/share/godot/**
/usr/local/bin/godot
~/.config/godot/**
key: ${{ runner.os }}-godot-${{ vars.GODOT_VERSION }}

- name: Download and config Godot Engine headless linux server
if: steps.cache-godot.outputs.cache-hit != 'true'
shell: bash
run: |
wget -q https://downloads.tuxfamily.org/godotengine/${{ vars.GODOT_VERSION }}/Godot_v${{ vars.GODOT_VERSION }}$URL_SUFFIX
mkdir ~/.cache
mkdir -p ~/.config/godot
unzip Godot_v${{ vars.GODOT_VERSION }}$URL_SUFFIX
mv Godot_v${{ vars.GODOT_VERSION }}-stable_linux_headless.64 /usr/local/bin/godot
godot -e -q
- name: Run tests
shell: bash
run: godot --headless --path . -d -s addons/gut/gut_cmdln.gd -gexit

0 comments on commit f37c835

Please sign in to comment.