From 40e8fb015c1feb49d1046344839a4a0e9b07b4f6 Mon Sep 17 00:00:00 2001 From: GsLogimaker Date: Thu, 16 May 2024 22:57:58 -0500 Subject: [PATCH] Update unittests.yml --- .github/workflows/unittests.yml | 111 +++++++++----------------------- 1 file changed, 29 insertions(+), 82 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 69d8d0f..b5078a9 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -72,7 +72,7 @@ jobs: # A list of files, directories, and wildcard patterns to cache and restore path: ./addons/glecs/bin/${{ matrix.target }}/release/${{ matrix.glecs_lib }} # An explicit key for restoring and saving the cache - key: glecslib.${{ matrix.target }} + key: glecslib.${{ matrix.target }}-${{ hashFiles('/addons/glecs/bin/') }} - name: Move lib run: | @@ -80,6 +80,7 @@ jobs: cp ./addons/glecs/bin/${{ matrix.target }}/release/${{ matrix.glecs_lib }} ./addons/glecs/bin/release/${{ matrix.glecs_lib }} cp ./addons/glecs/bin/${{ matrix.target }}/release/${{ matrix.glecs_lib }} ./addons/glecs/bin/debug/${{ matrix.glecs_lib }} + - name: 🤖 Setup Godot uses: chickensoft-games/setup-godot@v1 with: @@ -96,90 +97,34 @@ jobs: run: | godot -s res://addons/gut/gut_cmdln.gd --headless -gdir="res://unittests" -gexit - run_godot_test_suite: - needs: compile_glecs - - strategy: - matrix: - include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - glecs_lib: libglecs.so - # - os: ubuntu-latest - # target: x86_64-pc-windows-gnu - # glecs_lib: libglecs.dll - # - os: ubuntu-latest - # target: x86_64-pc-windows-gnu - # glecs_lib: libglecs.dll - - runs-on: ${{ matrix.os }} - - steps: - - name: 🐙 Settup git environment - uses: actions/checkout@v4 - - - name: ⏳ Load compiled library - uses: actions/cache/restore@v4.0.2 - with: - # A list of files, directories, and wildcard patterns to cache and restore - path: ./addons/glecs/bin/${{ matrix.target }}/release/${{ matrix.glecs_lib }} - # An explicit key for restoring and saving the cache - key: glecslib.${{ matrix.target }} - # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms - enableCrossOsArchive: true - - - name: Move lib - run: | - mkdir ./addons/glecs/bin/release/ - mkdir ./addons/glecs/bin/debug/ - cp ./addons/glecs/bin/${{ matrix.target }}/release/${{ matrix.glecs_lib }} ./addons/glecs/bin/release/${{ matrix.glecs_lib }} - cp ./addons/glecs/bin/${{ matrix.target }}/release/${{ matrix.glecs_lib }} ./addons/glecs/bin/debug/${{ matrix.glecs_lib }} - - - - name: 🤖 Setup Godot - uses: chickensoft-games/setup-godot@v1 - with: - # Version must include major, minor, and patch, and be >= 4.0.0 - version: 4.2.1 - - # This shouldn't be needed because the important files from .godot are - # included, but we run the import process just in case. - - name: 📧 Run Godot import - run: | - godot --headless --editor --quit-after 100 - - - name: ✏️ Run unittests - run: | - godot -s res://addons/gut/gut_cmdln.gd --headless -gdir="res://unittests" -gexit - - - - name: 🤖 Run Godot unit tests - id: run-godot-tests - uses: croconut/godot-tester@v5 - with: - # required - version: "4.2.1" - is-mono: "false" - # the folder with your project.godot file in it - path: "./" - # 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://unittests" - # default is GUTs default: 'res://.gutconfig.json'; set this to load a different config file - config-file: "res://.gut_editor_config.json" - # 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: 📄 Print logs - if: failure() && steps.run-godot-tests.outcome != 'success' - run: echo "$(cat logs/godot.log)" + + - name: 🤖 Run Godot unit tests + id: run-godot-tests + uses: croconut/godot-tester@v5 + with: + # required + version: "4.2.1" + is-mono: "false" + # the folder with your project.godot file in it + path: "./" + # 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://unittests" + # default is GUTs default: 'res://.gutconfig.json'; set this to load a different config file + config-file: "res://.gut_editor_config.json" + # 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: 📄 Print logs + if: failure() && steps.run-godot-tests.outcome != 'success' + run: echo "$(cat logs/godot.log)" update_nightly: - needs: run_godot_test_suite + needs: compile_glecs runs-on: windows-latest @@ -204,6 +149,7 @@ jobs: path: ./addons/glecs/bin/${{ env.LINUX_64_TARGET }}/release/${{ env.LINUX_64_LIB }} # An explicit key for restoring and saving the cache key: glecslib.${{ env.LINUX_64_TARGET }} + restore-keys: glecslib.${{ env.LINUX_64_TARGET }} # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms enableCrossOsArchive: true @@ -214,6 +160,7 @@ jobs: path: ./addons/glecs/bin/${{ env.WINDOWS_64_TARGET }}/release/${{ env.WINDOWS_64_LIB }} # An explicit key for restoring and saving the cache key: glecslib.${{ env.WINDOWS_64_TARGET }} + restore-keys: glecslib.${{ env.WINDOWS_64_TARGET }} # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms enableCrossOsArchive: true