.travis.yml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. language: objective-c
  2. osx_image: xcode11
  3. env:
  4. global:
  5. - LC_CTYPE=en_US.UTF-8
  6. - LANG=en_US.UTF-8
  7. notifications:
  8. email: false
  9. addons:
  10. homebrew:
  11. packages:
  12. - curl # Fix the codecov upload issue
  13. cache: cocoapods
  14. podfile: Podfile
  15. before_install:
  16. - env
  17. - locale
  18. - gem install cocoapods --no-document --quiet
  19. - gem install xcpretty --no-document --quiet
  20. - pod --version
  21. - pod repo update --silent
  22. - xcpretty --version
  23. - xcodebuild -version
  24. - xcodebuild -showsdks
  25. script:
  26. - set -o pipefail
  27. - echo Check if the library described by the podspec can be built
  28. - pod lib lint --allow-warnings --skip-tests # Will run test below
  29. - echo Build the SwiftPM
  30. - swift build
  31. - rm -rf ~/.build
  32. - echo Build as static library
  33. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImage static' -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
  34. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImage static' -sdk watchsimulator -configuration Debug | xcpretty -c
  35. - echo Clean DerivedData
  36. - rm -rf ~/Library/Developer/Xcode/DerivedData/
  37. - echo Build as dynamic frameworks
  38. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImage' -sdk macosx -configuration Debug | xcpretty -c
  39. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImage' -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
  40. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImage' -sdk appletvsimulator -configuration Debug | xcpretty -c
  41. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImage' -sdk watchsimulator -configuration Debug | xcpretty -c
  42. # - xcodebuild archive -project SDWebImage.xcodeproj -scheme 'SDWebImage' -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' -configuration Debug | xcpretty -c
  43. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImageMapKit' -sdk macosx -configuration Debug | xcpretty -c
  44. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImageMapKit' -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
  45. - xcodebuild build -project SDWebImage.xcodeproj -scheme 'SDWebImageMapKit' -sdk appletvsimulator -configuration Debug | xcpretty -c
  46. # - xcodebuild archive -project SDWebImage.xcodeproj -scheme 'SDWebImageMapKit' -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' -configuration Debug | xcpretty -c
  47. - echo Clean DerivedData
  48. - rm -rf ~/Library/Developer/Xcode/DerivedData/
  49. - echo Build the Demo apps
  50. - pod install
  51. - xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage OSX Demo' -destination 'platform=macOS,arch=x86_64' -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
  52. - xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage iOS Demo' -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
  53. - xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage TV Demo' -destination 'platform=tvOS Simulator,name=Apple TV 4K' -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
  54. - xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage Watch Demo' -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
  55. # - xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage iOS Demo' -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
  56. - echo Clean DerivedData
  57. - rm -rf ~/Library/Developer/Xcode/DerivedData/
  58. - mkdir DerivedData
  59. - echo Run the tests
  60. - xcodebuild clean test -workspace SDWebImage.xcworkspace -scheme 'Tests' -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug -UseModernBuildSystem=NO CODE_SIGNING_ALLOWED=NO | xcpretty -c
  61. - mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
  62. - xcodebuild clean test -workspace SDWebImage.xcworkspace -scheme 'Tests Mac' -destination 'platform=macOS,arch=x86_64' -configuration Debug -UseModernBuildSystem=NO CODE_SIGNING_ALLOWED=NO | xcpretty -c
  63. - mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
  64. after_success:
  65. - export PATH="/usr/local/opt/curl/bin:$PATH"
  66. - curl --version
  67. - bash <(curl -s https://codecov.io/bash) -D './DerivedData/macOS' -J '^SDWebImage$' -c -X gcov -F macos
  68. - bash <(curl -s https://codecov.io/bash) -D './DerivedData/iOS' -J '^SDWebImage$' -c -X gcov -F ios