Add workflow to execute tests in PR

This commit is contained in:
Adrien Ufferte
2026-01-29 09:23:30 +01:00
parent 7a55ddcf45
commit 0e6318e312
2 changed files with 30 additions and 4 deletions
+30
View File
@@ -0,0 +1,30 @@
name: Godot Tests
on:
pull_request:
types: [opened, synchronize]
jobs:
gut:
runs-on: ubuntu-latest
env:
GODOT_VERSION: 4.6-stable
GODOT_BIN: godot/Godot_v4.6-stable_linux.x86_64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Godot
run: |
GODOT_ZIP=Godot_v${GODOT_VERSION}_linux.x86_64.zip
curl -L -o godot.zip "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/${GODOT_ZIP}"
unzip -q godot.zip -d godot
chmod +x "${GODOT_BIN}"
- name: Import project assets
run: |
"${GODOT_BIN}" --headless --import --path .
- name: Run GUT tests headlessly
run: |
"${GODOT_BIN}" --headless --path . -s res://addons/gut/gut_cmdln.gd -gdir=res://tests -gexit
-4
View File
@@ -2,20 +2,16 @@ extends GutTest
func test_equal() -> void:
# this test will pass because 1 does equal 1
assert_eq(1, 1)
func test_not_equal() -> void:
# this test will fail because those strings are not equal
assert_ne('hello', 'goodbye')
func test_true() -> void:
# this test will fail because those strings are not equal
assert_true(true)
func test_false() -> void:
# this test will fail because those strings are not equal
assert_false(false)