kstenerud / KSCrash

The Ultimate iOS Crash Reporter
MIT License
4.25k stars 712 forks source link

Fix unit tests and add CI jobs #467

Closed bamx23 closed 6 months ago

bamx23 commented 6 months ago

This PR quickly fixes unit tests as a whole by disabling the parts that are broken. It's better to keep running the remaining working tests then not running them at all.

GLinnik21 commented 6 months ago

Strange. swift build fails with

2024-05-04T12:20:36.2050880Z /Users/runner/work/KSCrash/KSCrash/Sources/KSCrashRecording/Monitors/KSCrashMonitor.h:41:1: error: import of C++ module 'KSCrashRecordingCore' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]

Locally (on release-2.0) builds fine.

GLinnik21 commented 6 months ago

It seems that it is not a trivial task to run swift test on iOS simulators. Looks like this toolchain is designed to build and test for and on the local machine. Swift forums suggest using xcodebuild for a case like we have. https://forums.swift.org/t/i-made-a-little-swiftpm-package-that-uses-uikit-how-can-i-run-tests-from-command-line/50399 https://forums.swift.org/t/swiftpm-and-library-unit-testing/26255

bamx23 commented 6 months ago

Great! Just update the xcodebuild action to the latest version and we're good to go.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: mxcl/xcodebuild@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Had to make a fork and fixed version of Node there: https://github.com/mxcl/xcodebuild/pull/103. Once PR is accepted we can switch back to upstream.