Skip to content

Commit f831708

Browse files
committed
test providing a summary for test cases
1 parent 3efa6c2 commit f831708

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ci-cmake.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_call:
44

55
env:
6-
# Only used for the cache key. Increment version to force clean build.
6+
# Only used for the cache key. Increment version to force a clean build.
77
GODOT_BASE_BRANCH: master
88
# Used to select the version of Godot to run the tests with.
99
GODOT_TEST_VERSION: master
@@ -177,9 +177,10 @@ jobs:
177177
path: godot-artifacts
178178

179179
- name: Run tests
180-
if: matrix.run-tests
181180
run: python -X utf8 run-tests.py --verbose --godot-test-versions "${{ matrix.godot-test-versions }}" --godot-test-arch "${{ matrix.godot-test-arch }}"
182181
working-directory: test
182+
env:
183+
GITHUB_STEP_SUMMARY: ${{ env.GITHUB_STEP_SUMMARY }}
183184

184185
- name: Upload artifact
185186
uses: actions/upload-artifact@v4

test/run-tests.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,21 @@ def silent(*_args, **_kwargs):
619619
status = "PASSED" if success else "FAILED"
620620
print(f"TEST SUITE ({version or 'default'}) {status} - took {duration}s")
621621

622+
# push the summary to the github environment var
623+
summary_path = os.environ.get("GITHUB_STEP_SUMMARY")
624+
if summary_path:
625+
try:
626+
with open(summary_path, "a", encoding="utf-8") as f:
627+
f.write(f"\n## Test Results - {platform or 'unknown'} ({os.environ.get('RUNNER_OS', 'unknown')})\n\n")
628+
f.write("| Godot Version | Status | Duration (s) |\n")
629+
f.write("|---------------|--------|--------------|\n")
630+
# You would need to collect per-version results in the loop
631+
# For now, a simple overall:
632+
overall_status = "✅ PASSED" if overall_success else "❌ FAILED"
633+
f.write(f"| All tested versions | {overall_status} | {duration} |\n")
634+
except Exception:
635+
pass # silently ignore if summary writing fails
636+
622637
builtins.print = original_print
623638
sys.exit(0 if overall_success else 3)
624639

0 commit comments

Comments
 (0)