From 03573f8ab6aeeccde346bf5f2448d9c14e5b2a8a Mon Sep 17 00:00:00 2001 From: Andrew Watt Date: Tue, 18 Jun 2024 19:47:33 -0700 Subject: [PATCH] exclude macros from iOS testing --- .github/workflows/swift.yaml | 30 +++++++++++++++--------------- project.yml | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/.github/workflows/swift.yaml b/.github/workflows/swift.yaml index 69377206..72b7c1e1 100644 --- a/.github/workflows/swift.yaml +++ b/.github/workflows/swift.yaml @@ -52,7 +52,7 @@ jobs: -destination "$IOS_DESTINATION" \ build test | bundle exec xcpretty - xcodegen: + xcodegen-apps: runs-on: macos-latest steps: @@ -67,7 +67,7 @@ jobs: - name: Generate Xcode project run: xcodegen generate - - name: ObservableScreen - iOS + - name: ObservableScreen run: | xcodebuild \ -project Workflow.xcodeproj \ @@ -76,16 +76,7 @@ jobs: -skipMacroValidation \ build - - name: ObservableScreen - macOS - run: | - xcodebuild \ - -project Workflow.xcodeproj \ - -scheme "ObservableScreen" \ - -destination "platform=macOS" \ - -skipMacroValidation \ - build - - spm: + package-tests: runs-on: macos-latest steps: @@ -94,15 +85,24 @@ jobs: - name: Switch Xcode run: sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app - - name: Swift Package Manager - iOS + - name: Install XcodeGen + run: brew install xcodegen + + - name: Generate Xcode project + run: xcodegen generate + + # Macros are only built for the compiler platform, so we cannot run macro tests on iOS. Instead + # we target the "Tests" scheme from project.yml which selectively includes all the other tests. + - name: Tests - iOS run: | xcodebuild \ - -scheme "Workflow-Package" \ + -scheme "Tests" \ -destination "$IOS_DESTINATION" \ -skipMacroValidation \ test - - name: Swift Package Manager - macOS + # On macOS we can run all tests, including macro tests. + - name: Tests - macOS run: | xcodebuild \ -scheme "Workflow-Package" \ diff --git a/project.yml b/project.yml index bf06e088..2e710b9d 100644 --- a/project.yml +++ b/project.yml @@ -22,6 +22,28 @@ targets: UILaunchScreen: UIColorName: "" + # This is a scheme for all tests except for macros. + Tests: + platform: iOS + type: bundle.unit-test + info: + path: TestingSupport/AppHost/App/Info.plist + scheme: + testTargets: + - package: Workflow/WorkflowCombineTestingTests + - package: Workflow/WorkflowCombineTests + - package: Workflow/WorkflowConcurrencyTestingTests + - package: Workflow/WorkflowConcurrencyTests + - package: Workflow/WorkflowReactiveSwiftTestingTests + - package: Workflow/WorkflowReactiveSwiftTests + - package: Workflow/WorkflowRxSwiftTestingTests + - package: Workflow/WorkflowRxSwiftTests + - package: Workflow/WorkflowSwiftUIExperimentalTests + - package: Workflow/WorkflowSwiftUITests + - package: Workflow/WorkflowTestingTests + - package: Workflow/WorkflowTests + - package: Workflow/WorkflowUITests + # to add app-hosted test targets: # ViewEnvironmentUI-Tests: