diff --git a/.github/actions/build-and-test-with-slang/action.yml b/.github/actions/build-and-test-with-slang/action.yml index bab81064c..287b0d3a2 100644 --- a/.github/actions/build-and-test-with-slang/action.yml +++ b/.github/actions/build-and-test-with-slang/action.yml @@ -187,12 +187,18 @@ runs: run: python tools/ci.py test-examples -p # Upload Crashpad Reports + # Upload the whole database rather than just reports/: Windows writes minidumps directly to + # reports/, but POSIX Crashpad leaves them in pending/ until the Python harness copies them + # over, which never happens when the C++ sgl_tests step itself crashes (#1062). - name: Upload Crashpad Reports if: always() && contains(inputs.flags, 'crashpad') uses: actions/upload-artifact@v7 with: name: crash-reports-${{ inputs.os }}-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.config }} - path: .crashpad/reports/ + path: .crashpad/ + # .crashpad is a dot-directory; upload-artifact treats its contents as hidden and skips + # them by default, which if-no-files-found:ignore would silently mask. + include-hidden-files: true if-no-files-found: ignore # Generate Coverage Report diff --git a/tests/sgl/sgl_tests.cpp b/tests/sgl/sgl_tests.cpp index bdab52d31..691093f84 100644 --- a/tests/sgl/sgl_tests.cpp +++ b/tests/sgl/sgl_tests.cpp @@ -4,9 +4,11 @@ #include "sgl/sgl.h" #include "sgl/device/device.h" #include "sgl/device/agility_sdk.h" +#include "sgl/core/config.h" #include "sgl/core/object.h" #include "sgl/core/logger.h" #include "sgl/core/error.h" +#include "sgl/utils/crashpad.h" #define DOCTEST_CONFIG_IMPLEMENT #include @@ -50,6 +52,17 @@ int main(int argc, char** argv) { sgl::testing::static_init(); +#if SGL_HAS_CRASHPAD + // Capture teardown faults (#1062) as a minidump. The database must be the `.crashpad` + // directory CI archives, not the default beside the binary. Arming is best-effort: + // these diagnostics must never affect the test result. + try { + sgl::crashpad::start_handler({}, ".crashpad"); + } catch (const std::exception& e) { + sgl::log_warn("Failed to start Crashpad handler: {}", e.what()); + } +#endif + doctest::Context context(argc, argv); context.setOption("--reporters", "sgl");