Skip to content

Commit bfb1c43

Browse files
ci: Address CI Inconsistency By Upgrading to Latest
1 parent 1ffcaa6 commit bfb1c43

File tree

9 files changed

+75
-51
lines changed

9 files changed

+75
-51
lines changed

.github/workflows/build-and-lint.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ permissions:
1212
checks: write
1313
id-token: write
1414

15+
env:
16+
XCODE_VERSION: "16.4"
17+
1518
jobs:
1619
pod-lint:
17-
runs-on: macOS-13
20+
runs-on: macOS-15
1821
steps:
1922
- name: Checkout
2023
uses: actions/checkout@v4
2124

2225
- name: Select Xcode
23-
run: sudo xcode-select -s /Applications/Xcode_15.2.app
26+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
2427

2528
- name: Update xcodeproj gem
2629
run: sudo gem install xcodeproj
@@ -34,44 +37,53 @@ jobs:
3437
- name: Undo twitter change to podspec
3538
run: git checkout *.podspec
3639

37-
carthage-build:
38-
runs-on: macOS-13
40+
xcode-build:
41+
runs-on: macOS-15
3942
steps:
4043
- name: Checkout
4144
uses: actions/checkout@v4
4245

4346
- name: Select Xcode
44-
run: sudo xcode-select -s /Applications/Xcode_15.2.app
45-
46-
- name: Build with Carthage
47-
run: ./Scripts/carthage.sh build --no-skip-current || true
48-
49-
- name: Carthage archive
50-
run: carthage archive mParticle_Apple_SDK && carthage archive mParticle_Apple_SDK_NoLocation
47+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
5148

52-
- name: Verify carthage products
53-
run: ls 2>&1 | grep .framework.zip
49+
- name: Build SDK
50+
run: |
51+
set -o pipefail
52+
xcodebuild \
53+
-project "mParticle-Apple-SDK.xcodeproj" \
54+
-scheme "mParticle-Apple-SDK" \
55+
-destination "generic/platform=iOS" \
56+
clean build | xcpretty
57+
58+
- name: Build SDK NoLocation
59+
run: |
60+
set -o pipefail
61+
xcodebuild \
62+
-project "mParticle-Apple-SDK.xcodeproj" \
63+
-scheme "mParticle-Apple-SDK-NoLocation" \
64+
-destination "generic/platform=iOS" \
65+
clean build | xcpretty
5466
5567
run-analyzer:
56-
runs-on: macOS-13
68+
runs-on: macOS-15
5769
steps:
5870
- name: Checkout
5971
uses: actions/checkout@v4
6072

6173
- name: Select Xcode
62-
run: sudo xcode-select -s /Applications/Xcode_15.2.app
74+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
6375

6476
- name: Run static analyzer
6577
run: |
66-
bash -c '! (set -o pipefail && xcodebuild -project "mParticle-Apple-SDK.xcodeproj" -scheme "mParticle-Apple-SDK" -sdk iphonesimulator -configuration Debug -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" clean analyze | grep -v "warning: The iOS Simulator deployment target" | grep -B3 "warning")'
78+
bash -c '! (set -o pipefail && xcodebuild -project "mParticle-Apple-SDK.xcodeproj" -scheme "mParticle-Apple-SDK" -sdk iphonesimulator -configuration Debug -destination "platform=iOS Simulator,name=iPhone 16 Pro,OS=latest" clean analyze | grep -v "warning: The iOS Simulator deployment target" | grep -v "warning: Metadata extraction skipped" | grep -B3 "warning")'
6779
6880
pr-notify:
6981
if: >
7082
github.event_name == 'pull_request' &&
7183
github.event.pull_request.draft == false
7284
needs:
7385
- pod-lint
74-
- carthage-build
86+
- xcode-build
7587
- run-analyzer
7688
name: Notify GChat
7789
uses: ROKT/rokt-workflows/.github/workflows/oss_pr_opened_notification.yml@main

.github/workflows/build-secondary-platforms.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ name: Secondary Platforms iOS Build
22

33
on: [pull_request]
44

5+
env:
6+
XCODE_VERSION: "16.4"
7+
58
jobs:
69
build-react-native:
7-
runs-on: macOS-13
10+
runs-on: macOS-15
811
defaults:
912
run:
1013
working-directory: ./RNExample/ios
@@ -13,7 +16,7 @@ jobs:
1316
uses: actions/checkout@v4
1417

1518
- name: Select Xcode
16-
run: sudo xcode-select -s /Applications/Xcode_15.2.app
19+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
1720

1821
- name: Add React Native cli
1922
run: yarn add -D @react-native-community/cli
@@ -25,4 +28,4 @@ jobs:
2528
run: pod install
2629

2730
- name: Build iOS extension scheme
28-
run: xcodebuild -allowProvisioningUpdates -workspace RNExample.xcworkspace -scheme RNExample -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest'
31+
run: xcodebuild -allowProvisioningUpdates -workspace RNExample.xcworkspace -scheme RNExample -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=latest'

.github/workflows/cross-platform-tests.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ on:
88
branches:
99
- development
1010

11+
env:
12+
XCODE_VERSION: "16.4"
13+
1114
jobs:
1215
run-ios-tests:
1316
timeout-minutes: 30
14-
runs-on: macOS-13
17+
runs-on: macOS-15
1518
steps:
1619
- name: "Checkout Cross Platform Tests"
1720
uses: actions/checkout@v4
@@ -24,21 +27,21 @@ jobs:
2427
with:
2528
ref: ${{ github.head_ref }}
2629
path: .sdks/apple
27-
- name: "Install JDK 11"
28-
uses: actions/setup-java@v2
30+
- name: "Install JDK 17"
31+
uses: actions/setup-java@v4
2932
with:
3033
distribution: "zulu"
31-
java-version: "11"
34+
java-version: "17"
3235
cache: "gradle"
3336
- name: "Install Cocoapods"
3437
run: sudo gem install cocoapods; sudo gem install cocoapods-generate
3538
- name: Choose Xcode version
36-
run: xcode-select -p; sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer; xcode-select -p
39+
run: xcode-select -p; sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer; xcode-select -p
3740
- name: Run Tests
3841
run: ./gradlew runIos
3942
- name: Archive Test Results
4043
if: always()
41-
uses: actions/upload-artifact@v2
44+
uses: actions/upload-artifact@v4
4245
with:
4346
name: ios-test-results
4447
path: Users/runner/Library/Developer/Xcode/DerivedData

.github/workflows/native-tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,27 @@ on:
88
branches:
99
- development
1010

11+
env:
12+
XCODE_VERSION: "16.4"
13+
1114
jobs:
1215
native-unit-tests:
1316
strategy:
1417
matrix:
15-
xcode: ["15.2"]
1618
platform: [iOS, tvOS]
1719
scheme: [mParticle-Apple-SDK, mParticle-Apple-SDK-NoLocation]
1820
include:
1921
- platform: iOS
20-
device: iPhone 15
22+
device: iPhone 16 Pro
2123
- platform: tvOS
22-
device: Apple TV
23-
runs-on: macos-13
24+
device: Apple TV 4K (3rd generation)
25+
runs-on: macOS-15
2426
steps:
2527
- name: Checkout
2628
uses: actions/checkout@v4
2729

2830
- name: Select Xcode
29-
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
31+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
3032

3133
- name: Run iOS unit tests
3234
run: xcodebuild -project mParticle-Apple-SDK.xcodeproj -scheme ${{ matrix.scheme }} -destination 'platform=${{ matrix.platform }} Simulator,name=${{ matrix.device }},OS=latest' test

.github/workflows/sdk-release.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
required: true
99
default: "true"
1010

11+
env:
12+
XCODE_VERSION: "16.4"
13+
1114
jobs:
1215
# SDK release is done from main branch.
1316
confirm-main-branch:
@@ -16,7 +19,7 @@ jobs:
1619

1720
create-release-branch:
1821
name: Create release branch
19-
runs-on: macOS-13
22+
runs-on: macOS-15
2023
needs: confirm-main-branch
2124
steps:
2225
- name: Checkout development branch
@@ -33,7 +36,7 @@ jobs:
3336
3437
release:
3538
name: Perform release
36-
runs-on: macOS-13
39+
runs-on: macOS-15
3740
needs: create-release-branch
3841
env:
3942
GITHUB_ACCESS_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
@@ -43,7 +46,7 @@ jobs:
4346
uses: actions/checkout@v4
4447

4548
- name: Select Xcode
46-
run: sudo xcode-select -s /Applications/Xcode_15.2.app
49+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
4750

4851
- name: Validate environment
4952
env:
@@ -113,10 +116,10 @@ jobs:
113116
run: |
114117
npx \
115118
-p lodash \
116-
-p semantic-release@17 \
117-
-p @semantic-release/changelog@5 \
118-
-p @semantic-release/git@9 \
119-
-p @semantic-release/exec@5 \
119+
-p semantic-release@24 \
120+
-p @semantic-release/changelog@6 \
121+
-p @semantic-release/git@10 \
122+
-p @semantic-release/exec@6 \
120123
semantic-release --dry-run
121124
122125
- name: Release
@@ -133,10 +136,10 @@ jobs:
133136
run: |
134137
npx \
135138
-p lodash \
136-
-p semantic-release@17 \
137-
-p @semantic-release/changelog@5 \
138-
-p @semantic-release/git@9 \
139-
-p @semantic-release/exec@5 \
139+
-p semantic-release@24 \
140+
-p @semantic-release/changelog@6 \
141+
-p @semantic-release/git@10 \
142+
-p @semantic-release/exec@6 \
140143
semantic-release
141144
142145
- name: Push automated release commits to release branch
@@ -155,7 +158,7 @@ jobs:
155158
sync-repository:
156159
name: Finalize release
157160
needs: release
158-
runs-on: macOS-13
161+
runs-on: macOS-15
159162
steps:
160163
- name: Checkout main branch
161164
uses: actions/checkout@v4

mParticle-Apple-SDK/Data Model/MPIntegrationAttributes.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ - (nonnull instancetype)initWithIntegrationId:(nonnull NSNumber *)integrationId
5353
return nil;
5454
}
5555

56-
self = [self initWithIntegrationId:integrationId attributes:attributes];
56+
// Ensure attributes is not nil before passing to init method
57+
NSDictionary<NSString *, NSString *> *safeAttributes = attributes ?: @{};
58+
self = [self initWithIntegrationId:integrationId attributes:safeAttributes];
5759
return self;
5860
}
5961

mParticle-Apple-SDK/Kits/MPKitRegister.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
@implementation MPKitRegister
77

88
- (instancetype)init {
9-
id invalidVar = nil;
10-
self = [self initWithName:invalidVar className:invalidVar];
9+
self = [self initWithName:@"" className:@""];
1110
if (self) {
1211
MPILogError(@"MPKitRegister cannot be initialized using the init method");
1312
}

mParticle-Apple-SDK/Network/MPNetworkCommunication.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ - (void)requestConfig:(nullable NSObject<MPConnectorProtocol> *)connector withCo
526526
}
527527
}
528528

529-
[MPListenerController.sharedInstance onNetworkRequestFinished:MPEndpointConfig url:self.configURL.url.absoluteString body:configurationDictionary responseCode:responseCode];
529+
[MPListenerController.sharedInstance onNetworkRequestFinished:MPEndpointConfig url:(self.configURL.url.absoluteString ?: @"") body:(configurationDictionary ?: @{}) responseCode:responseCode];
530530
if (success && configurationDictionary) {
531531
NSDictionary *headersDictionary = [httpResponse allHeaderFields];
532532
NSString *eTag = headersDictionary[kMPHTTPETagHeaderKey];
@@ -1040,7 +1040,7 @@ - (void)identityApiRequestWithURL:(NSURL*)url identityRequest:(MPIdentityHTTPBas
10401040

10411041
self.identifying = NO;
10421042

1043-
[MPListenerController.sharedInstance onNetworkRequestFinished:endpointType url:url.absoluteString body:responseDictionary responseCode:responseCode];
1043+
[MPListenerController.sharedInstance onNetworkRequestFinished:endpointType url:(url.absoluteString ?: @"") body:(responseDictionary ?: @{}) responseCode:responseCode];
10441044
if (success) {
10451045
if (responseString) {
10461046
MPILogVerbose(@"Identity response:\n%@", responseString);

mParticle-Apple-SDK/mParticle.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,11 +1923,11 @@ - (void)handleWebviewCommand:(NSString *)command dictionary:(NSDictionary *)dict
19231923

19241924
}];
19251925
} else if ([command hasPrefix:kMParticleWebViewPathSetUserTag]) {
1926-
if ((NSNull *)dictionary[@"key"] != [NSNull null]) {
1926+
if (dictionary[@"key"] && (NSNull *)dictionary[@"key"] != [NSNull null]) {
19271927
[self.identity.currentUser setUserTag:dictionary[@"key"]];
19281928
}
19291929
} else if ([command hasPrefix:kMParticleWebViewPathRemoveUserTag]) {
1930-
if ((NSNull *)dictionary[@"key"] != [NSNull null]) {
1930+
if (dictionary[@"key"] && (NSNull *)dictionary[@"key"] != [NSNull null]) {
19311931
[self.identity.currentUser removeUserAttribute:dictionary[@"key"]];
19321932
}
19331933
} else if ([command hasPrefix:kMParticleWebViewPathSetUserAttribute]) {
@@ -1941,7 +1941,7 @@ - (void)handleWebviewCommand:(NSString *)command dictionary:(NSDictionary *)dict
19411941
[self.identity.currentUser setUserAttribute:dictionary[@"key"] value:dictionary[@"value"]];
19421942
}
19431943
} else if ([command hasPrefix:kMParticleWebViewPathRemoveUserAttribute]) {
1944-
if ((NSNull *)dictionary[@"key"] != [NSNull null]) {
1944+
if (dictionary[@"key"] && (NSNull *)dictionary[@"key"] != [NSNull null]) {
19451945
[self.identity.currentUser removeUserAttribute:dictionary[@"key"]];
19461946
}
19471947
} else if ([command hasPrefix:kMParticleWebViewPathSetSessionAttribute]) {

0 commit comments

Comments
 (0)