-
Notifications
You must be signed in to change notification settings - Fork 93
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
Fix support for Xcode 9 -> 10.2 #363
Changes from all commits
6d571ca
943311b
b8e0c86
962cba2
4bc5afb
021348b
4a61079
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
version: 2.1 | ||
|
||
step-library: | ||
- &restore-cache | ||
restore_cache: | ||
keys: | ||
- carthage-cache-mbdirections-v3-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} | ||
- carthage-cache-mbdirections-v3-{{ .Environment.CIRCLE_JOB }} # used if checksum fails | ||
|
||
- &save-cache | ||
save_cache: | ||
key: carthage-cache-mbdirections-v3-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} | ||
paths: | ||
- Carthage | ||
|
||
- &prepare | ||
run: | ||
name: Prepare | ||
command: | | ||
if [ $(carthage outdated | grep -cF "latest Carthage version") -eq 0 ]; then brew update && brew upgrade carthage || true; fi | ||
echo "foo" > ~/.mapbox | ||
|
||
- &publish-codecov | ||
run: | ||
name: Publish code coverage | ||
command: bash <(curl -s https://codecov.io/bash) | ||
|
||
jobs: | ||
build-job: | ||
parameters: | ||
xcode: | ||
type: string | ||
device: | ||
type: string | ||
default: "iPhone 6 Plus" | ||
iOS: | ||
type: string | ||
default: "12.1" | ||
watchOS: | ||
type: string | ||
default: "5.0" | ||
tvOS: | ||
type: string | ||
default: "12.0" | ||
test: | ||
type: boolean | ||
default: true | ||
codecoverage: | ||
type: boolean | ||
default: false | ||
macos: | ||
xcode: << parameters.xcode >> | ||
environment: | ||
HOMEBREW_NO_AUTO_UPDATE: 1 | ||
steps: | ||
- checkout | ||
- *prepare | ||
- *restore-cache | ||
- run: | ||
name: Install prerequisites | ||
command: | | ||
if [ $(xcversion simulators | grep -cF "iOS << parameters.iOS >> Simulator (installed)") -eq 0 ]; then xcversion simulators --install="iOS << parameters.iOS >>" || true; fi | ||
- run: | ||
name: Dependencies | ||
command: | | ||
carthage bootstrap --platform ios --cache-builds --configuration Debug --no-use-binaries | ||
carthage bootstrap --platform tvos --cache-builds --configuration Debug --no-use-binaries | ||
carthage bootstrap --platform macos --cache-builds --configuration Debug --no-use-binaries | ||
carthage bootstrap --platform watchos --cache-builds --configuration Debug --no-use-binaries | ||
- *save-cache | ||
- run: | ||
name: iOS | ||
command: xcodebuild -sdk iphonesimulator -project MapboxDirections.xcodeproj -scheme 'MapboxDirections iOS' -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=<< parameters.device >>' clean build <<# parameters.test >>test<</ parameters.test >><<# parameters.codecoverage >> -enableCodeCoverage "YES"<</ parameters.codecoverage >> | ||
- when: | ||
condition: << parameters.codecoverage >> | ||
steps: | ||
- *publish-codecov | ||
- run: | ||
name: tvOS | ||
command: xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections tvOS' -destination 'platform=tvOS Simulator,name=Apple TV 4K (at 1080p),OS=<< parameters.tvOS >>' clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >> | ||
- when: | ||
condition: << parameters.codecoverage >> | ||
steps: | ||
- *publish-codecov | ||
- run: | ||
name: macOS | ||
command: xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections Mac' clean build<<# parameters.test >> test <</ parameters.test >><<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >> | ||
- run: | ||
name: watchOS | ||
command: xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=<< parameters.watchOS >>' clean build | ||
|
||
workflows: | ||
workflow: | ||
jobs: | ||
- build-job: | ||
name: "Xcode_10.2" | ||
xcode: "10.2.0" | ||
iOS: "12.2" | ||
tvOS: "12.2" | ||
watchOS: "5.2" | ||
- build-job: | ||
name: "Xcode_10.0" | ||
xcode: "10.0.0" | ||
iOS: "12.0" | ||
tvOS: "12.0" | ||
codecoverage: true | ||
- build-job: | ||
name: "Xcode_9.4" | ||
xcode: "9.4.1" | ||
iOS: "9.3" | ||
tvOS: "11.4" | ||
watchOS: "4.3" | ||
test: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 4.4 | ||
github "AliSoftware/OHHTTPStubs" ~> 6.0 | ||
github "linksmt/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.8.0" | ||
github "AliSoftware/OHHTTPStubs" "6.1.0" | ||
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.9.0" | ||
github "linksmt/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca" | ||
github "raphaelmor/Polyline" "v4.2.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ class V5Tests: XCTestCase { | |
} | ||
XCTAssertNotNil(task) | ||
|
||
waitForExpectations(timeout: 2) { (error) in | ||
waitForExpectations(timeout: 5) { (error) in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even locally, 2 seconds did timeout 1/16 times for the 3.2 MB GeoJSON There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yikes, somehow I didn’t realize our test fixtures were that big. This isn’t a performance test, so we should probably think about breaking this test case up into minimal test cases the next time we need to fix it. |
||
XCTAssertNil(error, "Error: \(error!)") | ||
XCTAssertEqual(task.state, .completed) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a PR for this change or something else we can keep track of for when master gets updated? AliSoftware/OHHTTPStubs#295 is already in v7.0.0; is this for something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, looks like this commit also pulls in AliSoftware/OHHTTPStubs#286. The CircleCI configuration isn’t testing on watchOS anyways. So I think we can pin to the main pod’s v7.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, the reason why I switched to the fork here is the missing watchOS scheme in the original. We don't test on watchOS but we do compile for watchOS. We could switch back but it would require a workaround to run carthage bootstrap and ignore the .private and .resolved files.