From f5cbdc74380ffada90ee716e702e961125076987 Mon Sep 17 00:00:00 2001 From: Kotauror Date: Fri, 6 Dec 2024 13:55:42 +0100 Subject: [PATCH 1/7] test: refactor: add tests for ios MarketDomain --- .../project.pbxproj | 29 ++++---- .../MarketDomainTests.swift | 32 +++++++++ ...masterIgniteExampleTests-Bridging-Header.h | 4 ++ .../TicketmasterIgniteExampleTests.m | 66 ------------------- ios/MarketDomain.swift | 8 +-- ios/PrePurchaseSDK+Extension.swift | 3 +- ios/PrePurchaseSDK.swift | 3 +- ios/PurchaseSDK.swift | 3 +- 8 files changed, 62 insertions(+), 86 deletions(-) create mode 100644 example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift create mode 100644 example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h delete mode 100644 example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests.m diff --git a/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj b/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj index eef1e9d..24438d3 100644 --- a/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj +++ b/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj @@ -7,8 +7,8 @@ objects = { /* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* TicketmasterIgniteExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* TicketmasterIgniteExampleTests.m */; }; 0C80B921A6F3F58F76C31292 /* libPods-TicketmasterIgniteExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-TicketmasterIgniteExample.a */; }; + 0D48C3D82D02FAA30001158F /* MarketDomainTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D48C3D72D02FAA30001158F /* MarketDomainTests.swift */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; @@ -30,7 +30,8 @@ /* Begin PBXFileReference section */ 00E356EE1AD99517003FC87E /* TicketmasterIgniteExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TicketmasterIgniteExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* TicketmasterIgniteExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TicketmasterIgniteExampleTests.m; sourceTree = ""; }; + 0D48C3D62D02FAA30001158F /* TicketmasterIgniteExampleTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TicketmasterIgniteExampleTests-Bridging-Header.h"; sourceTree = ""; }; + 0D48C3D72D02FAA30001158F /* MarketDomainTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketDomainTests.swift; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* TicketmasterIgniteExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TicketmasterIgniteExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = TicketmasterIgniteExample/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = TicketmasterIgniteExample/AppDelegate.mm; sourceTree = ""; }; @@ -72,8 +73,9 @@ 00E356EF1AD99517003FC87E /* TicketmasterIgniteExampleTests */ = { isa = PBXGroup; children = ( - 00E356F21AD99517003FC87E /* TicketmasterIgniteExampleTests.m */, 00E356F01AD99517003FC87E /* Supporting Files */, + 0D48C3D72D02FAA30001158F /* MarketDomainTests.swift */, + 0D48C3D62D02FAA30001158F /* TicketmasterIgniteExampleTests-Bridging-Header.h */, ); path = TicketmasterIgniteExampleTests; sourceTree = ""; @@ -208,6 +210,7 @@ TargetAttributes = { 00E356ED1AD99517003FC87E = { CreatedOnToolsVersion = 6.2; + LastSwiftMigration = 1610; TestTargetID = 13B07F861A680F5B00A75B9A; }; 13B07F861A680F5B00A75B9A = { @@ -390,7 +393,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 00E356F31AD99517003FC87E /* TicketmasterIgniteExampleTests.m in Sources */, + 0D48C3D82D02FAA30001158F /* MarketDomainTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -419,6 +422,7 @@ baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-TicketmasterIgniteExample-TicketmasterIgniteExampleTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -437,6 +441,9 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 6.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TicketmasterIgniteExample.app/TicketmasterIgniteExample"; }; name = Debug; @@ -446,6 +453,7 @@ baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-TicketmasterIgniteExample-TicketmasterIgniteExampleTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; COPY_PHASE_STRIP = NO; INFOPLIST_FILE = TicketmasterIgniteExampleTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; @@ -461,6 +469,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h"; + SWIFT_VERSION = 6.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TicketmasterIgniteExample.app/TicketmasterIgniteExample"; }; name = Release; @@ -591,12 +601,10 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; USE_HERMES = true; }; name = Debug; @@ -667,10 +675,7 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift b/example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift new file mode 100644 index 0000000..0c5ae7a --- /dev/null +++ b/example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift @@ -0,0 +1,32 @@ +// +// SampleTest.swift +// TicketmasterIgniteExampleTests +// +// Created by justyna zygmunt on 06/12/2024. +// +import XCTest +import Testing +import TicketmasterFoundation +@testable import react_native_ticketmaster_ignite + +class MarketDomainObjectTests: XCTestCase { + let marketDomainObject = MarketDomainObject() + + func testGetMarketDomainReturnsCorrectDomainForUs() { + let domain = marketDomainObject.getMarketDomain(marketDomainConfig: "US") + + XCTAssertEqual(domain, MarketDomain.US, "getMarketDomain should return the correct domain for 'us'.") + } + + func testGetMarketDomainReturnsCorrectDomainForAU() { + let domain = marketDomainObject.getMarketDomain(marketDomainConfig: "AU") + + XCTAssertEqual(domain, MarketDomain.AU, "getMarketDomain should return the correct domain for 'AU'.") + } + + func testGetMarketDomainReturnsCorrectDomainWhenEmptyStringPassed() { + let domain = marketDomainObject.getMarketDomain(marketDomainConfig: "") + + XCTAssertEqual(domain, MarketDomain.US, "getMarketDomain should return US domain for empty strings.") + } +} diff --git a/example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h b/example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h new file mode 100644 index 0000000..1b2cb5d --- /dev/null +++ b/example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests.m b/example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests.m deleted file mode 100644 index 4f28f97..0000000 --- a/example/ios/TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests.m +++ /dev/null @@ -1,66 +0,0 @@ -#import -#import - -#import -#import - -#define TIMEOUT_SECONDS 600 -#define TEXT_TO_LOOK_FOR @"Welcome to React" - -@interface TicketmasterIgniteExampleTests : XCTestCase - -@end - -@implementation TicketmasterIgniteExampleTests - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen -{ - UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - - __block NSString *redboxError = nil; -#ifdef DEBUG - RCTSetLogFunction( - ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { - if (level >= RCTLogLevelError) { - redboxError = message; - } - }); -#endif - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - foundElement = [self findSubviewInView:vc.view - matching:^BOOL(UIView *view) { - if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - return NO; - }]; - } - -#ifdef DEBUG - RCTSetLogFunction(RCTDefaultLogFunction); -#endif - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - -@end diff --git a/ios/MarketDomain.swift b/ios/MarketDomain.swift index 06abe8d..82a4cd5 100644 --- a/ios/MarketDomain.swift +++ b/ios/MarketDomain.swift @@ -2,10 +2,8 @@ import TicketmasterFoundation class MarketDomainObject { static let shared = MarketDomainObject() - - let marketDomain = Config.shared.get(for: "marketDomain") - - func getMarketDomain() -> TicketmasterFoundation.MarketDomain { - return MarketDomain(countryCode: marketDomain.lowercased()) ?? MarketDomain.US + + func getMarketDomain(marketDomainConfig: String) -> TicketmasterFoundation.MarketDomain { + return MarketDomain(countryCode: marketDomainConfig.lowercased()) ?? MarketDomain.US } } diff --git a/ios/PrePurchaseSDK+Extension.swift b/ios/PrePurchaseSDK+Extension.swift index b72da40..e0d0d4c 100644 --- a/ios/PrePurchaseSDK+Extension.swift +++ b/ios/PrePurchaseSDK+Extension.swift @@ -27,10 +27,11 @@ extension PrePurchaseSDK: TMPrePurchaseNavigationDelegate, TMPrePurchaseAnalytic let apiKey = Config.shared.get(for: "apiKey") let region = Config.shared.get(for: "region") let primaryColor = Config.shared.get(for: "primaryColor") + let marketDomainConfig = Config.shared.get(for: "marketDomain") let backgroundColor = UIColor(hexString: primaryColor) ?? AppConstants.defaultBrandColor let eventHeaderTypeString = Config.shared.get(for: "eventHeaderType") let eventHeaderType = EventHeaderType(rawValue: eventHeaderTypeString) - let marketDomain = MarketDomainObject.shared.getMarketDomain() + let marketDomain = MarketDomainObject.shared.getMarketDomain(marketDomainConfig: marketDomainConfig) TMPurchase.shared.configure(apiKey: apiKey, region: TMAuthentication.TMXDeploymentRegion(rawValue: region) ?? .US, completion: {isPurchaseApiSet in print("Purchase api key set result: \(isPurchaseApiSet)") diff --git a/ios/PrePurchaseSDK.swift b/ios/PrePurchaseSDK.swift index c0377f0..c9bdb07 100644 --- a/ios/PrePurchaseSDK.swift +++ b/ios/PrePurchaseSDK.swift @@ -32,8 +32,9 @@ class PrePurchaseSDK: UIViewController { let apiKey = Config.shared.get(for: "apiKey") let region = Config.shared.get(for: "region") let primaryColor = Config.shared.get(for: "primaryColor") + let marketDomainConfig = Config.shared.get(for: "marketDomain") let backgroundColor = UIColor(hexString: primaryColor) ?? AppConstants.defaultBrandColor - let marketDomain = MarketDomainObject.shared.getMarketDomain() + let marketDomain = MarketDomainObject.shared.getMarketDomain(marketDomainConfig: marketDomainConfig) TMPrePurchase.shared.configure(apiKey: apiKey, region: TMAuthentication.TMXDeploymentRegion(rawValue: region) ?? .US, completion: { isPrePurchaseApiSet in print("PrePurchase api key set result: \(isPrePurchaseApiSet)") diff --git a/ios/PurchaseSDK.swift b/ios/PurchaseSDK.swift index 3a5d884..af12ba2 100644 --- a/ios/PurchaseSDK.swift +++ b/ios/PurchaseSDK.swift @@ -34,10 +34,11 @@ class PurchaseSDK: UIViewController { let apiKey = Config.shared.get(for: "apiKey") let region = Config.shared.get(for: "region") let primaryColor = Config.shared.get(for: "primaryColor") + let marketDomainConfig = Config.shared.get(for: "marketDomain") let backgroundColor = UIColor(hexString: primaryColor) ?? AppConstants.defaultBrandColor let eventHeaderTypeString = Config.shared.get(for: "eventHeaderType") let eventHeaderType = EventHeaderType(rawValue: eventHeaderTypeString) - let marketDomain = MarketDomainObject.shared.getMarketDomain() + let marketDomain = MarketDomainObject.shared.getMarketDomain(marketDomainConfig: marketDomainConfig) TMPurchase.shared.configure(apiKey: apiKey, region: TMAuthentication.TMXDeploymentRegion(rawValue: region) ?? .US, completion: { isPurchaseApiSet in print("Purchase api key set result: \(isPurchaseApiSet)") From 7f2a8285c7257a4c1460cdb301038aac73eee6fb Mon Sep 17 00:00:00 2001 From: Kotauror Date: Fri, 6 Dec 2024 14:18:10 +0100 Subject: [PATCH 2/7] ci: try to put on ci --- .github/workflows/ci.yml | 30 +++++++++++++++++++ example/ios/TestPlan.xctestplan | 24 +++++++++++++++ .../project.pbxproj | 4 +-- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 example/ios/TestPlan.xctestplan diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 376bd8a..b1794f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,3 +91,33 @@ jobs: - name: Build example for iOS run: | yarn turbo run build:ios + + - name: Run unit tests swift + run: | + yarn turbo run build:ios + + test-swift: + runs-on: macos-14 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Set up Xcode + run: | + sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer + xcodebuild -version + + - name: Install cocoapods + run: | + cd example/ios + pod install + env: + NO_FLIPPER: 1 + + - name: Run unit tests swift + run: | + cd example/ios + xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -destination 'platform=iOS Simulator,name=iPhone 16' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO test \ No newline at end of file diff --git a/example/ios/TestPlan.xctestplan b/example/ios/TestPlan.xctestplan new file mode 100644 index 0000000..309ebaf --- /dev/null +++ b/example/ios/TestPlan.xctestplan @@ -0,0 +1,24 @@ +{ + "configurations" : [ + { + "id" : "56E8F040-1EDF-4F87-9FCA-4B453EDE47E1", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + "testTimeoutsEnabled" : true + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:TicketmasterIgniteExample.xcodeproj", + "identifier" : "00E356ED1AD99517003FC87E", + "name" : "TicketmasterIgniteExampleTests" + } + } + ], + "version" : 1 +} diff --git a/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj b/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj index 24438d3..d66b2f4 100644 --- a/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj +++ b/example/ios/TicketmasterIgniteExample.xcodeproj/project.pbxproj @@ -443,7 +443,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TicketmasterIgniteExample.app/TicketmasterIgniteExample"; }; name = Debug; @@ -470,7 +470,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "TicketmasterIgniteExampleTests/TicketmasterIgniteExampleTests-Bridging-Header.h"; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TicketmasterIgniteExample.app/TicketmasterIgniteExample"; }; name = Release; From e8852e51d73fd5270e2520e818c8994815b1d8c9 Mon Sep 17 00:00:00 2001 From: Kotauror Date: Tue, 10 Dec 2024 10:30:39 +0100 Subject: [PATCH 3/7] test: remove import --- .../ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift b/example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift index 0c5ae7a..ee71301 100644 --- a/example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift +++ b/example/ios/TicketmasterIgniteExampleTests/MarketDomainTests.swift @@ -5,7 +5,6 @@ // Created by justyna zygmunt on 06/12/2024. // import XCTest -import Testing import TicketmasterFoundation @testable import react_native_ticketmaster_ignite From b370943d25b0d937878d6a8d54053a8ad3307a4b Mon Sep 17 00:00:00 2001 From: Kotauror Date: Tue, 10 Dec 2024 10:55:32 +0100 Subject: [PATCH 4/7] ci: try pass --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1794f1..f631a49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,10 +92,6 @@ jobs: run: | yarn turbo run build:ios - - name: Run unit tests swift - run: | - yarn turbo run build:ios - test-swift: runs-on: macos-14 steps: @@ -116,8 +112,12 @@ jobs: pod install env: NO_FLIPPER: 1 + + - name: Build example for iOS + run: | + yarn turbo run build:ios - name: Run unit tests swift run: | cd example/ios - xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -destination 'platform=iOS Simulator,name=iPhone 16' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO test \ No newline at end of file + xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -destination 'platform=iOS Simulator,name=iPhone 16' test \ No newline at end of file From 1cc7fdbb236a967d13749b0ae439b63c75b024ea Mon Sep 17 00:00:00 2001 From: Kotauror Date: Tue, 10 Dec 2024 11:04:15 +0100 Subject: [PATCH 5/7] test: update mac in ci --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f631a49..2e4495a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: yarn turbo run build:ios test-swift: - runs-on: macos-14 + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v3 @@ -112,12 +112,12 @@ jobs: pod install env: NO_FLIPPER: 1 - - - name: Build example for iOS - run: | - yarn turbo run build:ios + + - name: Clear DerivedData + run: | + rm -rf ~/Library/Developer/Xcode/DerivedData - name: Run unit tests swift run: | cd example/ios - xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -destination 'platform=iOS Simulator,name=iPhone 16' test \ No newline at end of file + xcodebuild clean test -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO \ No newline at end of file From c520c52f9ffd9efd50e0cd3d2781687bbeedcf99 Mon Sep 17 00:00:00 2001 From: Kotauror Date: Tue, 10 Dec 2024 13:42:00 +0100 Subject: [PATCH 6/7] ci: move test to turbo --- .github/workflows/ci.yml | 30 ------------------------------ example/package.json | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e4495a..376bd8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,33 +91,3 @@ jobs: - name: Build example for iOS run: | yarn turbo run build:ios - - test-swift: - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup - uses: ./.github/actions/setup - - - name: Set up Xcode - run: | - sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer - xcodebuild -version - - - name: Install cocoapods - run: | - cd example/ios - pod install - env: - NO_FLIPPER: 1 - - - name: Clear DerivedData - run: | - rm -rf ~/Library/Developer/Xcode/DerivedData - - - name: Run unit tests swift - run: | - cd example/ios - xcodebuild clean test -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO \ No newline at end of file diff --git a/example/package.json b/example/package.json index d474a4d..8d6457b 100644 --- a/example/package.json +++ b/example/package.json @@ -8,7 +8,7 @@ "ios": "react-native run-ios", "start": "react-native start", "build:android": "cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a", - "build:ios": "cd ios && xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO" + "build:ios": "cd ios && xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO clean test" }, "dependencies": { "@react-navigation/bottom-tabs": "^6.5.8", From b1d1e1615a9b1744081781e0bd23748510f6bc6c Mon Sep 17 00:00:00 2001 From: Kotauror Date: Tue, 10 Dec 2024 14:18:05 +0100 Subject: [PATCH 7/7] ci: revert turbo change --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ example/package.json | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 376bd8a..07482dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,3 +91,28 @@ jobs: - name: Build example for iOS run: | yarn turbo run build:ios + + test-ios: + runs-on: macos-14 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Install cocoapods + run: | + cd example/ios + pod install + env: + NO_FLIPPER: 1 + + - name: Clear DerivedData + run: | + rm -rf ~/Library/Developer/Xcode/DerivedData + + - name: run tests + run: | + cd example/ios + xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -destination 'platform=iOS Simulator,name=iPhone 16' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO clean test \ No newline at end of file diff --git a/example/package.json b/example/package.json index 8d6457b..d474a4d 100644 --- a/example/package.json +++ b/example/package.json @@ -8,7 +8,7 @@ "ios": "react-native run-ios", "start": "react-native start", "build:android": "cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a", - "build:ios": "cd ios && xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO clean test" + "build:ios": "cd ios && xcodebuild -workspace TicketmasterIgniteExample.xcworkspace -scheme TicketmasterIgniteExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO" }, "dependencies": { "@react-navigation/bottom-tabs": "^6.5.8",