Add workflow to execute tests in PR
This commit is contained in:
@@ -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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user