Skip to content

Commit

Permalink
Refactor macOS workflow and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Dec 29, 2023
1 parent 7b82ef4 commit de027a8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ jobs:
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
.build-test-debug/debug/OpenSwiftUIPackageTests.xctest/Contents/MacOS/OpenSwiftUIPackageTests \
> coverage.txt
- name: Build and run tests in debug mode with TSan
run: |
swift test \
-c debug \
--sanitize thread \
-Xswiftc -warnings-as-errors \
--build-path .build-test-debug-sanitize-thread
- name: Build and run tests in release mode
run: |
swift test \
Expand All @@ -51,4 +44,5 @@ jobs:
--build-path .build-test-release
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/OpenSwiftUIProject/OpenGraph",
"state" : {
"branch" : "main",
"revision" : "52266b713cf60eb23f4d7113fade9a79f4f47ff9"
"revision" : "4adbc0e5d44f1a5861a97b942d903635e25c9e00",
"version" : "0.0.1"
}
}
],
Expand Down
13 changes: 6 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ let openSwiftUITestTarget = Target.testTarget(
)
let openSwiftUICompatibilityTestTarget = Target.testTarget(
name: "OpenSwiftUICompatibilityTests",
dependencies: [
"OpenSwiftUI",
],
exclude: ["README.md"]
)

Expand All @@ -63,7 +60,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/OpenSwiftUIProject/OpenFoundation", from: "0.0.1"),
.package(url: "https://github.com/OpenSwiftUIProject/OpenGraph", branch: "main"),
.package(url: "https://github.com/OpenSwiftUIProject/OpenGraph", from: "0.0.1"),
],
targets: [
// TODO: Add SwiftGTK as an backend alternative for UIKit/AppKit on Linux and macOS
Expand Down Expand Up @@ -167,9 +164,11 @@ if swiftTestingCondition {
openSwiftUITestTarget.swiftSettings = swiftSettings
}

let swiftUICompatibilityTestCondition = envEnable("OPENSWIFTUI_SWIFTUI_COMPATIBILITY_TEST")
if swiftUICompatibilityTestCondition {
let compatibilityTestCondition = envEnable("OPENSWIFTUI_COMPATIBILITY_TEST")
if compatibilityTestCondition {
var swiftSettings: [SwiftSetting] = (openSwiftUICompatibilityTestTarget.swiftSettings ?? [])
swiftSettings.append(.define("OPENSWIFTUI_SWIFTUI_COMPATIBILITY_TEST"))
swiftSettings.append(.define("OPENSWIFTUI_COMPATIBILITY_TEST"))
openSwiftUICompatibilityTestTarget.swiftSettings = swiftSettings
} else {
openSwiftUICompatibilityTestTarget.dependencies.append("OpenSwiftUI")
}
2 changes: 1 addition & 1 deletion Tests/OpenSwiftUICompatibilityTests/DummyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import XCTest
#if OPENSWIFTUI_SWIFTUI_COMPATIBILITY_TEST
#if OPENSWIFTUI_COMPATIBILITY_TEST
import SwiftUI
#else
import OpenSwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Tests/OpenSwiftUICompatibilityTests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Test public API of OpenSwiftUI and run it against with SwiftUI on Apple Platform.

```swift
#if OPENSWIFTUI_SWIFTUI_COMPATIBILITY_TEST
#if OPENSWIFTUI_COMPATIBILITY_TEST
import SwiftUI
#else
import OpenSwiftUI
Expand Down

0 comments on commit de027a8

Please sign in to comment.