From fb60af3eb3adcba98ff6ee1caf1f0e902da8609f Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Sat, 6 Apr 2019 10:00:00 +0900 Subject: [PATCH] [CI] Refactor .travis.yml --- .travis.yml | 52 +++++++------------ .../ProtobufBodyParametersTests.swift | 3 ++ .../ProtobufDataParserTests.swift | 3 ++ 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53d24f72..cc4bfba4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,29 +4,16 @@ env: matrix: include: - - os: osx + - &podspec + os: osx language: objective-c - osx_image: xcode9.2 + osx_image: xcode10.2 script: - - set -o pipefail - - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release ENABLE_TESTABILITY=YES | xcpretty -c - - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release -sdk iphonesimulator -destination "name=iPhone 6s" ENABLE_TESTABILITY=YES | xcpretty -c - - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release -sdk appletvsimulator -destination "name=Apple TV" ENABLE_TESTABILITY=YES | xcpretty -c - after_success: - - bash <(curl -s https://codecov.io/bash) - - os: osx - language: objective-c - osx_image: xcode9.4 - script: - - set -o pipefail - - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release ENABLE_TESTABILITY=YES | xcpretty -c - - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release -sdk iphonesimulator -destination "name=iPhone 6s" ENABLE_TESTABILITY=YES | xcpretty -c - - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release -sdk appletvsimulator -destination "name=Apple TV" ENABLE_TESTABILITY=YES | xcpretty -c - after_success: - - bash <(curl -s https://codecov.io/bash) - - os: osx + - pod lib lint --allow-warnings + - &xcode + os: osx language: objective-c - osx_image: xcode10 + osx_image: xcode9.2 script: - set -o pipefail - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release ENABLE_TESTABILITY=YES | xcpretty -c @@ -34,24 +21,25 @@ matrix: - xcodebuild build-for-testing test-without-building -workspace APIKit.xcworkspace -scheme APIKit -configuration Release -sdk appletvsimulator -destination "name=Apple TV" ENABLE_TESTABILITY=YES | xcpretty -c after_success: - bash <(curl -s https://codecov.io/bash) - - os: osx + - <<: *xcode + osx_image: xcode9.4 + - <<: *xcode + osx_image: xcode10.1 + - <<: *xcode + osx_image: xcode10.2 + - &swiftpm + os: osx language: generic osx_image: xcode9.2 script: - swift build - swift test - - os: osx - language: generic + - <<: *swiftpm osx_image: xcode9.4 - script: - - swift build - - swift test - - os: osx - language: generic - osx_image: xcode10 - script: - - swift build - - swift test + - <<: *swiftpm + osx_image: xcode10.1 + - <<: *swiftpm + osx_image: xcode10.2 notifications: email: false diff --git a/Tests/APIKitTests/BodyParametersType/ProtobufBodyParametersTests.swift b/Tests/APIKitTests/BodyParametersType/ProtobufBodyParametersTests.swift index 844ea00d..e58102d3 100644 --- a/Tests/APIKitTests/BodyParametersType/ProtobufBodyParametersTests.swift +++ b/Tests/APIKitTests/BodyParametersType/ProtobufBodyParametersTests.swift @@ -4,6 +4,8 @@ import APIKit class ProtobufBodyParametersTests: XCTestCase { func testProtobufSuccess() { + // Temporarily gated due to https://openradar.appspot.com/49262697 + if #available(macOS 10.11, *) { let object = NSKeyedArchiver.archivedData(withRootObject: ["foo": 1, "bar": 2, "baz": 3]) let parameters = ProtobufBodyParameters(protobufObject: object) XCTAssertEqual(parameters.contentType, "application/protobuf") @@ -21,5 +23,6 @@ class ProtobufBodyParametersTests: XCTestCase { } catch { XCTFail() } + } } } diff --git a/Tests/APIKitTests/DataParserType/ProtobufDataParserTests.swift b/Tests/APIKitTests/DataParserType/ProtobufDataParserTests.swift index e517e5c7..968b31e0 100644 --- a/Tests/APIKitTests/DataParserType/ProtobufDataParserTests.swift +++ b/Tests/APIKitTests/DataParserType/ProtobufDataParserTests.swift @@ -9,6 +9,8 @@ class ProtobufDataParserTests: XCTestCase { } func testProtobufSuccess() { + // Temporarily gated due to https://openradar.appspot.com/49262697 + if #available(macOS 10.11, *) { let data = NSKeyedArchiver.archivedData(withRootObject: ["foo": 1, "bar": 2, "baz": 3]) let parser = ProtobufDataParser() @@ -21,5 +23,6 @@ class ProtobufDataParserTests: XCTestCase { } catch { XCTFail() } + } } }