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

Update CI, collect Code Coverage, Fix Xcode 10.2 build warnings #187

Merged
merged 7 commits into from
Apr 24, 2019
Merged
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
108 changes: 108 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
version: 2.1

step-library:
- &restore-cache
restore_cache:
keys:
- cache-mbgeocoder-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }}
- cache-mbgeocoder-v1-{{ .Environment.CIRCLE_JOB }} # used if checksum fails

- &save-cache
save_cache:
key: cache-mbgeocoder-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }}
paths:
- Carthage

- &prepare
run:
name: Prepare
command: |
curl -L https://github.com/Carthage/Carthage/releases/download/0.33.0/Carthage.pkg >> Carthage.pkg
sudo installer -pkg Carthage.pkg -target /
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
- 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
- *restore-cache
- 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 MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder 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 MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder 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 MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder Mac' clean build<<# parameters.test >> test <</ parameters.test >><<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
- run:
name: watchOS
command: xcodebuild -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder 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_iOS_12"
xcode: "10.2.0"
iOS: "12.2"
tvOS: "12.2"
watchOS: "5.2"
codecoverage: true
- build-job:
name: "Xcode_10.2_iOS_9"
xcode: "10.2.0"
iOS: "9.3"
tvOS: "12.2"
watchOS: "5.2"
2 changes: 1 addition & 1 deletion Cartfile.private
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.0
github "AliSoftware/OHHTTPStubs" ~> 6.0
github "frederoni/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MapboxDirections.swift depends on a different fork for AliSoftware/OHHTTPStubs#286; we should be consistent one way or the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll migrate to this fork in MapboxDirections.

4 changes: 2 additions & 2 deletions Cartfile.resolved
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.6.0"
github "AliSoftware/OHHTTPStubs" "6.1.0"
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.10.0"
github "frederoni/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca"
38 changes: 18 additions & 20 deletions MapboxGeocoder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -729,50 +729,50 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = Mapbox;
TargetAttributes = {
DA5170951CF1B18F00CD6DCF = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0910;
LastSwiftMigration = 1020;
};
DA51709E1CF1B18F00CD6DCF = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0920;
LastSwiftMigration = 1020;
};
DA5170C01CF253EE00CD6DCF = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0910;
LastSwiftMigration = 1020;
};
DA5170C91CF253EE00CD6DCF = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0920;
LastSwiftMigration = 1020;
};
DA5170EA1CF2581900CD6DCF = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 1020;
};
DD342B4F19A140EE00219F77 = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
DDC2470319A1C3B40054B0C0 = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
DDC2472919A1C60E0054B0C0 = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 0800;
};
DDF1E8491BD6F7BA00C40C78 = {
CreatedOnToolsVersion = 7.0.1;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = DD342B4B19A140EE00219F77 /* Build configuration list for PBXProject "MapboxGeocoder" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -1155,7 +1155,6 @@
PRODUCT_NAME = MapboxGeocoder;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -1188,7 +1187,6 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -1213,7 +1211,6 @@
PRODUCT_NAME = MapboxGeocoderTests;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
};
name = Debug;
};
Expand All @@ -1237,7 +1234,6 @@
PRODUCT_NAME = MapboxGeocoderTests;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
};
name = Release;
};
Expand All @@ -1264,7 +1260,6 @@
PRODUCT_NAME = MapboxGeocoder;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -1297,7 +1292,6 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -1322,7 +1316,7 @@
PRODUCT_NAME = MapboxGeocoderTests;
SDKROOT = appletvos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
Expand All @@ -1345,7 +1339,7 @@
PRODUCT_NAME = MapboxGeocoderTests;
SDKROOT = appletvos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
Expand Down Expand Up @@ -1411,6 +1405,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BITCODE_GENERATION_MODE = bitcode;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -1470,6 +1465,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BITCODE_GENERATION_MODE = bitcode;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -1531,7 +1527,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Geocoder.Swift;
PRODUCT_NAME = "Geocoder (Swift)";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1550,7 +1545,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Geocoder.Swift;
PRODUCT_NAME = "Geocoder (Swift)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1575,6 +1569,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2,3";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -1597,6 +1592,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2,3";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -1651,6 +1647,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGeocoderTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2,3";
};
name = Debug;
};
Expand All @@ -1670,6 +1667,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGeocoderTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2,3";
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading