-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.travis.yml
47 lines (43 loc) · 1.66 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
# references:
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage
# Run tests on Ubuntu and macOS
os:
- linux
- osx
# Ubuntu 14.04
dist: trusty
# Generic language as travis doesn't know anything about SPM and Linux
language: generic
sudo: required
osx_image: xcode9.4
xcode_sdk: iphonesimulator11.4
# cache: cocoapods
# podfile: Example/Podfile
before_install:
- if [ $TRAVIS_OS_NAME == "osx" ]; then instruments -s devices; fi
- if [ $TRAVIS_OS_NAME == "osx" ]; then gem install cocoapods; fi # Since Travis is not always on latest version
- if [ $TRAVIS_OS_NAME == "osx" ]; then pod repo update; fi
- if [ $TRAVIS_OS_NAME == "osx" ]; then pod install --project-directory=Example; fi
- if [ $TRAVIS_OS_NAME == "osx" ]; then
echo "macOS build. swiftenv will not be installed.";
else
git clone https://github.com/kylef/swiftenv.git ~/.swiftenv;
export SWIFTENV_ROOT="$HOME/.swiftenv";
export PATH="$SWIFTENV_ROOT/bin:$PATH";
eval "$(swiftenv init -)";
swiftenv install $(cat .swift-version);
fi
script:
# Output something every 10 minutes or Travis kills the job
- while sleep 60; do echo "=====[ $SECONDS seconds still running ]====="; done &
# Actual script
- if [ $TRAVIS_OS_NAME == "osx" ]; then
set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/Keystore.xcworkspace -scheme Keystore-Example -sdk iphonesimulator11.4 -destination 'platform=iOS Simulator,name=iPhone X,OS=11.4' ONLY_ACTIVE_ARCH=YES | xcpretty;
pod lib lint --allow-warnings;
fi
- swift build
- swift build -c release
- swift test
# Kill background echo job
- kill %1