|
| 1 | +language: generic |
| 2 | + |
| 3 | +git: |
| 4 | + submodules: false |
| 5 | + |
| 6 | +notifications: |
| 7 | + slack: |
| 8 | + secure: "kgflM3rOhAUsGm6hbs7VUJcXr+FCcslBsg8tRVre569mzI+eMUauMtJINdhRn5nGwUXGinvORbFwmHHh+2TJrYGVCg/FZzTlm3dCdziiGnJnZ+6Pj4vGCgRlpawSSpRuUEYORRzCA9p2GKMKU2hBYPGGzshUfWq5XGJtyWBJuTAqKAP3Foc2kHL7ANFgmo48Nhc2T2CCXW9uFZ98M9Vpg5pi0PRKpEIywUz//xvP6MCmtuXzpQKTVT9IsvFtDJn4R+RZ//geNyJm+u5AlX6PNrQ7y2fqW0wmPJdwAh2E9EoZE2bWD/xL0W+J27kGTeEHkyPmDo7SPsbyhD5Y/rViXOSZXi3PICFAzJ7z1WkhgpzpV2J1JEKcqPSfjq2ZQiE0ZkDUfr/HekYrHgu6IKzB4PCZn6la3c7ncEGNXUzrWmrFip60D34/xsjW8Frh2JOwzs+iQbYunxS/UVuhCH4AXfdZ9uqGBmjKfWxyj+KERYqX3AyyftmZBvLJ0gOjYhUqoD8gBcZCS1KdVXpTMBsnJpMohoyHb8wuAB6e45eQz7ayaqaLaiUBlRqmz3AwVyL6MKXvUhTYwx1YeRRfOM7WEIOnXB9FeyFyvhJuQvvRfY2Mp6LiUyfpdl3wRN18xUZqD65ThPoqe9HB/V8seg+5kfhEPqlFEXpf2WPAJf4IYW8=" |
| 9 | + |
| 10 | +env: |
| 11 | + global: |
| 12 | + - PROJECT=StickyLocking.xcodeproj |
| 13 | + - SCHEME=StickyLocking-Package |
| 14 | + - TEST_SDK=iphonesimulator |
| 15 | + |
| 16 | +matrix: |
| 17 | + include: |
| 18 | + - |
| 19 | + os: linux |
| 20 | + dist: trusty |
| 21 | + sudo: required |
| 22 | + env: |
| 23 | + - BUILD="cmake build" |
| 24 | + - |
| 25 | + os: osx |
| 26 | + osx_image: xcode9.3 |
| 27 | + env: |
| 28 | + - BUILD="cmake build" |
| 29 | + - |
| 30 | + os: linux |
| 31 | + dist: trusty |
| 32 | + sudo: required |
| 33 | + env: |
| 34 | + - BUILD="swift build" |
| 35 | + - |
| 36 | + os: osx |
| 37 | + osx_image: xcode9.3 |
| 38 | + env: |
| 39 | + - BUILD="swift build" |
| 40 | + - |
| 41 | + os: osx |
| 42 | + osx_image: xcode9.3 |
| 43 | + env: |
| 44 | + - BUILD="pod lint" |
| 45 | + - |
| 46 | + os: osx |
| 47 | + osx_image: xcode9.3 |
| 48 | + env: |
| 49 | + - BUILD="xcodebuild" |
| 50 | + - TEST_DEST="platform=iOS Simulator,OS=11.3,name=iPhone 8" |
| 51 | + |
| 52 | + |
| 53 | +# don't re-build for tags so that [publish binary] is not re-run |
| 54 | +# https://github.com/travis-ci/travis-ci/issues/1532 |
| 55 | +branches: |
| 56 | + except: |
| 57 | + - /^[0-9]/ |
| 58 | + |
| 59 | +before_install: |
| 60 | + # |
| 61 | + # If there is a Gemfile for this os, install bundler and ask bundler to install the gems |
| 62 | + # |
| 63 | + - | |
| 64 | + if [ -e Gemfile ]; then |
| 65 | + export BUNDLE_GEMFILE=Gemfile |
| 66 | + gem install bundler |
| 67 | + bundler install |
| 68 | + fi |
| 69 | + # |
| 70 | + # OSX requires swiftlint be installed |
| 71 | + # |
| 72 | + - | |
| 73 | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then |
| 74 | + brew unlink swiftlint |
| 75 | + brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/b4bd27d43e3df20735e2704eaf05b37ce5a6d626/Formula/swiftlint.rb |
| 76 | + fi |
| 77 | + # |
| 78 | + # Linux requires downloading Swift and tools |
| 79 | + # |
| 80 | + - | |
| 81 | + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then |
| 82 | + sudo apt-get update -y |
| 83 | + sudo apt-get -y install clang-3.8 lldb-3.8 libicu-dev |
| 84 | +
|
| 85 | + wget https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz |
| 86 | + tar xzvf swift-4.1-RELEASE-ubuntu14.04.tar.gz |
| 87 | + export PATH=$(pwd)/swift-4.1-RELEASE-ubuntu14.04/usr/bin:$PATH |
| 88 | + fi |
| 89 | +
|
| 90 | +script: |
| 91 | + - | |
| 92 | + if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 93 | + # Fix travis issue: https://github.com/travis-ci/travis-ci/issues/6307 |
| 94 | + rvm get head --auto-dotfiles || true |
| 95 | + fi |
| 96 | + - | |
| 97 | + if [[ "$BUILD" == "cmake build" ]]; then |
| 98 | + set -e # Fail (and stop build) on first non zero exit code |
| 99 | + cmake ./ |
| 100 | + make tests |
| 101 | + set +e |
| 102 | + fi |
| 103 | + - | |
| 104 | + if [[ "$BUILD" == "swift build" ]]; then |
| 105 | + set -e # Fail (and stop build) on first non zero exit code |
| 106 | + swift test |
| 107 | + set +e |
| 108 | + fi |
| 109 | + - | |
| 110 | + if [[ "$BUILD" == "pod lint" ]]; then |
| 111 | + set -e # Fail (and stop build) on first non zero exit code |
| 112 | + bundler exec pod repo update |
| 113 | + bundler exec pod lib lint |
| 114 | + set +e |
| 115 | + fi |
| 116 | + - | |
| 117 | + if [[ "$BUILD" == "xcodebuild" ]]; then |
| 118 | + set -e # Fail (and stop build) on first non zero exit code |
| 119 | + cmake ./ |
| 120 | + make xcode-project |
| 121 | + set -o pipefail |
| 122 | + xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$TEST_DEST" -sdk "$TEST_SDK" -enableCodeCoverage YES build-for-testing | bundler exec xcpretty |
| 123 | + xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$TEST_DEST" -sdk "$TEST_SDK" -enableCodeCoverage YES test | bundler exec xcpretty |
| 124 | + set +o pipefail |
| 125 | + set +e |
| 126 | + fi |
| 127 | +
|
| 128 | +after_success: |
| 129 | + - bash <(curl -s https://codecov.io/bash) |
| 130 | + |
0 commit comments