yourkarma/JWT

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: objective-c
matrix:
    include:
        - osx_image: xcode12.5
        # - osx_image: xcode8.3

before_install:
    # - brew update
    #- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi
    # install
    # - rvm use 2.2.2 --install --binary --fuzzy
    # - gem install cocoapods --no-rdoc --no-ri --no-document --quiet
    - gem install xcpretty --no-document
    # - pod --version
    # - pod setup --silent > /dev/null
    # - pod repo update --silent
    - xcpretty --version
    - xcodebuild -version
    - xcodebuild -showsdks
script:
    # 32-bit tests
    # - xctool -sdk iphonesimulator clean test -destination "name=iPhone 5" -find-target "JWTTests"
    # 64-bit tests
    # - xctool -sdk iphonesimulator clean test -destination "name=iPhone 5s" -find-target "JWTTests"

    # Thanks CocoaLumberjack!

    - set -o pipefail

    - echo Check if the library described by the podspec can be built
    - pod lib lint --allow-warnings

    # Unused.
    # - echo "Build as dynamic framework (ObjectiveC), each platform (osx, ios)"
    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-macOS' -configuration Release -sdk macosx | xcpretty -c
    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-iOS' -configuration Release -sdk iphonesimulator | xcpretty -c

    # - echo "Build as dynamic framework (Swift), each platform (osx, ios)"
    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-macOS-Swift' -configuration Release -sdk macosx | xcpretty -c
    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-iOS-Swift' -configuration Release -sdk iphonesimulator | xcpretty -c

    # Framework.
    - echo "Build dynamic universal for each platform (osx, ios)"
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk macosx | xcpretty -c
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk iphonesimulator | xcpretty -c
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk appletvsimulator | xcpretty -c
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk watchsimulator | xcpretty -c

    # Static Library.
    # We need to change order in case of xcodebuild bug.
    # xcodebuild does not remove static library on -clean action.
    # In this case
    # static library after framework is ok.
    # framework after static library is bad.
    # beer and wine order, heh.
    - echo "Build iOS Static library"
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk macosx | xcpretty -c
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk iphonesimulator | xcpretty -c
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk appletvsimulator | xcpretty -c
    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk watchsimulator | xcpretty -c
    
    # Tests.
    - echo Run iOS Tests
    # 32-bit tests
    # TODO: Add xsimctl invocation to install iPhone 5 or 5s simulators.
    # - echo 32-bit tests
    # - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'iOS_Tests' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=latest' | xcpretty -c
    # # 64-bit tests
    - echo Run iOS 64-bit tests
    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'iOS_Tests' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11,OS=latest' | xcpretty -c
    # mac OS tests
    - echo Run Mac OS tests
    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'macOS_Tests' -sdk macosx | xcpretty -c
    # tvOS tests
    - echo Run tvOS tests
    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'tvOS_Tests' -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV,OS=latest' | xcpretty -c
    # watchOS tests
    - echo Run watchOS tests
    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'watchOS_Tests' -sdk watchsimulator -destination 'platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm,OS=latest'