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