Skip to content

Commit 639dda0

Browse files
committed
Run on iOS 9 and fix codecov
1 parent 4bc5afb commit 639dda0

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

.circleci/config.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ step-library:
44
- &restore-cache
55
restore_cache:
66
keys:
7-
- carthage-cache-mbdirections-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }}
8-
- carthage-cache-mbdirections-v1- # used if checksum fails
7+
- carthage-cache-mbdirections-v2-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }}
8+
- carthage-cache-mbdirections-v2-{{ .Environment.CIRCLE_JOB }} # used if checksum fails
99

1010
- &save-cache
1111
save_cache:
12-
key: carthage-cache-mbdirections-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }}
12+
key: carthage-cache-mbdirections-v2-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }}
1313
paths:
1414
- Carthage
1515

@@ -20,6 +20,11 @@ step-library:
2020
if [ $(carthage outdated | grep -cF "latest Carthage version") -eq 0 ]; then brew update && brew upgrade carthage || true; fi
2121
echo "foo" > ~/.mapbox
2222
23+
- &publish-codecov
24+
run:
25+
name: Publish code coverage
26+
command: bash <(curl -s https://codecov.io/bash)
27+
2328
jobs:
2429
build-job:
2530
parameters:
@@ -52,30 +57,37 @@ jobs:
5257
- *prepare
5358
- *restore-cache
5459
- run:
55-
name: iOS
60+
name: Install prerequisites
5661
command: |
57-
carthage bootstrap --platform ios --cache-builds --no-use-binaries --new-resolver
58-
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 >>
62+
if [ $(xcversion simulators | grep -cF "iOS << parameters.iOS >> Simulator (installed)") -eq 0 ]; then xcversion simulators --install="iOS << parameters.iOS >>" || true; fi
5963
- run:
60-
name: tvOS
64+
name: Dependencies
6165
command: |
62-
carthage bootstrap --platform tvos --cache-builds --no-use-binaries --new-resolver
63-
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 >>
66+
carthage bootstrap --platform ios --cache-builds --no-use-binaries
67+
carthage bootstrap --platform tvos --cache-builds --no-use-binaries
68+
carthage bootstrap --platform macos --cache-builds --no-use-binaries
69+
carthage bootstrap --platform watchos --cache-builds --no-use-binaries
70+
- *save-cache
6471
- run:
65-
name: macOS
66-
command: |
67-
carthage bootstrap --platform macos --cache-builds --no-use-binaries --new-resolver
68-
xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections Mac' clean build<<# parameters.test >> test <</ parameters.test >><<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
72+
name: iOS
73+
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 >>
74+
- when:
75+
condition: << parameters.codecoverage >>
76+
steps:
77+
- *publish-codecov
6978
- run:
70-
name: watchOS
71-
command: |
72-
carthage bootstrap --platform watchos --cache-builds --no-use-binaries --new-resolver
73-
xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=<< parameters.watchOS >>' clean build
79+
name: tvOS
80+
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 >>
7481
- when:
7582
condition: << parameters.codecoverage >>
7683
steps:
77-
- run: bash <(curl -s https://codecov.io/bash)
78-
- *save-cache
84+
- *publish-codecov
85+
- run:
86+
name: macOS
87+
command: xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections Mac' clean build<<# parameters.test >> test <</ parameters.test >><<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
88+
- run:
89+
name: watchOS
90+
command: xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=<< parameters.watchOS >>' clean build
7991

8092
workflows:
8193
workflow:
@@ -86,15 +98,16 @@ workflows:
8698
iOS: "12.2"
8799
tvOS: "12.2"
88100
watchOS: "5.2"
89-
codecoverage: true
90101
- build-job:
91102
name: "Xcode_10.0"
92103
xcode: "10.0.0"
93104
iOS: "12.0"
94105
tvOS: "12.0"
106+
codecoverage: true
95107
- build-job:
96108
name: "Xcode_9.4"
97109
xcode: "9.4.1"
98-
iOS: "10.3.1"
110+
iOS: "9.3"
99111
tvOS: "11.4"
100112
watchOS: "4.3"
113+
test: false

0 commit comments

Comments
 (0)