From 333119236799bb1aacc57c77767498f11fbd0863 Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 23 Sep 2024 23:59:22 +0800 Subject: [PATCH] Fix CI issue --- .github/workflows/compatibility_tests.yml | 3 +++ Sources/OpenSwiftUICore/Log/Signpost.swift | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/compatibility_tests.yml b/.github/workflows/compatibility_tests.yml index 5045db9..c18b365 100644 --- a/.github/workflows/compatibility_tests.yml +++ b/.github/workflows/compatibility_tests.yml @@ -32,12 +32,14 @@ jobs: - name: Run compatibility tests on OpenSwiftUI + macOS run: | swift test \ + --filter OpenSwiftUICompatibilityTests \ --build-path .build-compatibility-test-debug env: OPENSWIFTUI_COMPATIBILITY_TEST: 0 - name: Run compatibility tests on SwiftUI + macOS run: | swift test \ + --filter OpenSwiftUICompatibilityTests \ --build-path .build-compatibility-test-debug env: OPENSWIFTUI_COMPATIBILITY_TEST: 1 @@ -69,6 +71,7 @@ jobs: run: swift --version - name: Run compatibility tests on OpenSwiftUI + iOS run: | + # FIXME: xcodebuild will run all test targets. xcodebuild test \ -scheme OpenSwiftUI \ -configuration Debug \ diff --git a/Sources/OpenSwiftUICore/Log/Signpost.swift b/Sources/OpenSwiftUICore/Log/Signpost.swift index 213bf93..d9b749e 100644 --- a/Sources/OpenSwiftUICore/Log/Signpost.swift +++ b/Sources/OpenSwiftUICore/Log/Signpost.swift @@ -123,6 +123,7 @@ package struct Signpost { guard isEnabled else { return closure() } + #if canImport(Darwin) let id = OSSignpostID.makeExclusiveID(object) switch style { case let .kdebug(code): @@ -138,6 +139,9 @@ package struct Signpost { defer { os_signpost(.end, log: _signpostLog, name: name, signpostID: id) } return closure() } + #else + return closure() + #endif } @_transparent @@ -150,6 +154,7 @@ package struct Signpost { guard isEnabled else { return closure() } + #if canImport(Darwin) let id = OSSignpostID.makeExclusiveID(object) switch style { case let .kdebug(code): @@ -161,6 +166,9 @@ package struct Signpost { defer { os_signpost(.end, log: _signpostLog, name: name, signpostID: id) } return closure() } + #else + return closure() + #endif } @_transparent