Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Strict Concurrency Checking #104

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,70 +18,77 @@ on:
jobs:
buildandtest_ios:
name: Build and Test Swift Package iOS
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@feature/warnings-as-errors
with:
runsonlabels: '["macOS", "self-hosted"]'
scheme: Spezi-Package
resultBundle: Spezi-Package-iOS.xcresult
artifactname: Spezi-Package-iOS.xcresult
warningsAsErrors: true
buildandtest_watchos:
name: Build and Test Swift Package watchOS
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@feature/warnings-as-errors
with:
runsonlabels: '["macOS", "self-hosted"]'
scheme: Spezi-Package
destination: 'platform=watchOS Simulator,name=Apple Watch Series 9 (45mm)'
resultBundle: Spezi-Package-watchOS.xcresult
artifactname: Spezi-Package-watchOS.xcresult
warningsAsErrors: true
buildandtest_visionos:
name: Build and Test Swift Package visionOS
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@feature/warnings-as-errors
with:
runsonlabels: '["macOS", "self-hosted"]'
scheme: Spezi-Package
destination: 'platform=visionOS Simulator,name=Apple Vision Pro'
resultBundle: Spezi-Package-visionOS.xcresult
artifactname: Spezi-Package-visionOS.xcresult
warningsAsErrors: true
buildandtest_tvos:
name: Build and Test Swift Package tvOS
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@feature/warnings-as-errors
with:
runsonlabels: '["macOS", "self-hosted"]'
scheme: Spezi-Package
destination: 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'
resultBundle: Spezi-Package-tvOS.xcresult
artifactname: Spezi-Package-tvOS.xcresult
warningsAsErrors: true
buildandtest_macos:
name: Build and Test Swift Package macOS
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@feature/warnings-as-errors
with:
runsonlabels: '["macOS", "self-hosted"]'
scheme: Spezi-Package
destination: 'platform=macOS,arch=arm64'
resultBundle: Spezi-Package-macOS.xcresult
artifactname: Spezi-Package-macOS.xcresult
warningsAsErrors: true
buildandtestuitests_ios:
name: Build and Test UI Tests iOS
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@feature/warnings-as-errors
with:
runsonlabels: '["macOS", "self-hosted"]'
path: Tests/UITests
scheme: TestApp
resultBundle: TestApp-iOS.xcresult
artifactname: TestApp-iOS.xcresult
warningsAsErrors: true
buildandtestuitests_visionos:
name: Build and Test UI Tests visionOS
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@feature/warnings-as-errors
with:
runsonlabels: '["macOS", "self-hosted"]'
path: Tests/UITests
scheme: TestApp
destination: 'platform=visionOS Simulator,name=Apple Vision Pro'
resultBundle: TestApp-visionOS.xcresult
artifactname: TestApp-visionOS.xcresult
warningsAsErrors: true
uploadcoveragereport:
name: Upload Coverage Report
needs: [buildandtest_ios, buildandtest_watchos, buildandtest_visionos, buildandtest_tvos, buildandtest_macos, buildandtestuitests_ios, buildandtestuitests_visionos]
uses: StanfordSpezi/.github/.github/workflows/create-and-upload-coverage-report.yml@v2
uses: StanfordSpezi/.github/.github/workflows/create-and-upload-coverage-report.yml@feature/warnings-as-errors
with:
coveragereports: Spezi-Package-iOS.xcresult Spezi-Package-watchOS.xcresult Spezi-Package-visionOS.xcresult Spezi-Package-tvOS.xcresult Spezi-Package-macOS.xcresult TestApp-iOS.xcresult TestApp-visionOS.xcresult
19 changes: 16 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
import PackageDescription


#if swift(<6)
let swiftSettings: [SwiftSetting] = [
.enableExperimentalFeature("SwiftConcurrency")
]
#else
let swiftSettings: [SwiftSetting] = [
.enableUpcomingFeature("SwiftConcurrency")
]
#endif

let package = Package(
name: "Spezi",
defaultLocalization: "en",
Expand All @@ -35,21 +45,24 @@ let package = Package(
dependencies: [
.product(name: "SpeziFoundation", package: "SpeziFoundation"),
.product(name: "XCTRuntimeAssertions", package: "XCTRuntimeAssertions")
]
],
swiftSettings: swiftSettings
),
.target(
name: "XCTSpezi",
dependencies: [
.target(name: "Spezi")
]
],
swiftSettings: swiftSettings
),
.testTarget(
name: "SpeziTests",
dependencies: [
.target(name: "Spezi"),
.target(name: "XCTSpezi"),
.product(name: "XCTRuntimeAssertions", package: "XCTRuntimeAssertions")
]
],
swiftSettings: swiftSettings
)
]
)
4 changes: 4 additions & 0 deletions Tests/UITests/UITests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
TVOS_DEPLOYMENT_TARGET = 17.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
Expand Down Expand Up @@ -456,6 +457,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_STRICT_CONCURRENCY = complete;
TVOS_DEPLOYMENT_TARGET = 17.0;
VALIDATE_PRODUCT = YES;
XROS_DEPLOYMENT_TARGET = 1.0;
Expand Down Expand Up @@ -553,6 +555,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,7";
TEST_TARGET_NAME = TestApp;
Expand All @@ -578,6 +581,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,7";
TEST_TARGET_NAME = TestApp;
Expand Down
Loading