.travis.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. language: objective-c
  2. osx_image: xcode8.3
  3. branches:
  4. only:
  5. - master
  6. env:
  7. global:
  8. - LC_CTYPE=en_US.UTF-8
  9. - LANG=en_US.UTF-8
  10. - WORKSPACE=Alamofire.xcworkspace
  11. - IOS_FRAMEWORK_SCHEME="Alamofire iOS"
  12. - MACOS_FRAMEWORK_SCHEME="Alamofire macOS"
  13. - TVOS_FRAMEWORK_SCHEME="Alamofire tvOS"
  14. - WATCHOS_FRAMEWORK_SCHEME="Alamofire watchOS"
  15. - EXAMPLE_SCHEME="iOS Example"
  16. matrix:
  17. - DESTINATION="OS=3.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
  18. - DESTINATION="OS=2.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
  19. - DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES"
  20. - DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
  21. - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
  22. - DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
  23. - DESTINATION="OS=9.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
  24. - DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
  25. before_install:
  26. - gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet
  27. script:
  28. - set -o pipefail
  29. - xcodebuild -version
  30. - xcodebuild -showsdks
  31. # Build Framework in Debug and Run Tests if specified
  32. - if [ $RUN_TESTS == "YES" ]; then
  33. xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
  34. else
  35. xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
  36. fi
  37. # Build Framework in Release and Run Tests if specified
  38. - if [ $RUN_TESTS == "YES" ]; then
  39. xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
  40. else
  41. xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
  42. fi
  43. # Build Example in Debug if specified
  44. - if [ $BUILD_EXAMPLE == "YES" ]; then
  45. xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
  46. fi
  47. # Run `pod lib lint` if specified
  48. - if [ $POD_LINT == "YES" ]; then
  49. pod lib lint;
  50. fi