diff --git a/scripts/ci.sh b/scripts/ci.sh index df0376438..a2e813075 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -13,8 +13,8 @@ function xcode_major() { echo "$XCODE_MAJOR" } -function is_xcode_version_11_plus() { - if [[ `xcode_version` -ge 11 ]]; then +function is_xcode_version_above() { + if [[ `xcode_major` -ge $1 ]]; then return 0 else return 1 @@ -32,7 +32,7 @@ env NSUnbufferedIO=YES xcodebuild test -project KIF.xcodeproj -derivedDataPath=$ env NSUnbufferedIO=YES xcodebuild test -project KIF.xcodeproj -scheme KIF -derivedDataPath=${PWD}/build/KIF -destination "platform=iOS Simulator,${SIMULATOR}" | xcpretty -c # Due to unstable Swift language syntax, this only compiles on Xcode 8+ -if is_xcode_version_11_plus; then +if is_xcode_version_above 11 ; then env NSUnbufferedIO=YES xcodebuild test -project "Documentation/Examples/Testable Swift/Testable Swift.xcodeproj" -scheme "Testable Swift" -derivedDataPath=${PWD}/build/TestableSwift -destination "platform=iOS Simulator,${SIMULATOR}" | xcpretty -c fi @@ -40,8 +40,10 @@ env NSUnbufferedIO=YES xcodebuild test -project "Documentation/Examples/Testable # For some reason, attempting to run the Calculator tests on Xcode 7 causes a frequent crash in CI env NSUnbufferedIO=YES xcodebuild build -project "Documentation/Examples/Calculator/Calculator.xcodeproj" -scheme "Calculator" -derivedDataPath=${PWD}/build/Calculator -destination "platform=iOS Simulator,${SIMULATOR}" | xcpretty -c -carthage build --no-skip-current -carthage archive KIF +if ! is_xcode_version_above 12 ; then # see https://github.com/Carthage/Carthage/issues/3019 for Xcode 12 support + carthage build --no-skip-current + carthage archive KIF +fi swift build -Xcc "-isysroot" -Xcc "$(xcrun --sdk iphonesimulator --show-sdk-path)" -Xcc "-target" -Xcc "x86_64-apple-ios$(xcrun --sdk iphonesimulator --show-sdk-version)-simulator"