forked from koraykoska/rocksdb.swift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
57 lines (51 loc) · 1.96 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
# 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: xcode11.2
xcode_sdk: iphonesimulator13.2
before_install:
- if [ $TRAVIS_OS_NAME == "osx" ]; then instruments -s devices; 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
- swift build
- swift build -c release
- |
if [ $TRAVIS_OS_NAME == "osx" ]; then
swift package generate-xcodeproj;
# Replace header search paths in xcodeproj until SPM fixes this... https://bugs.swift.org/browse/SR-11804
sed -i "" 's/\"upstream\",/\"\$(SRCROOT)\/Sources\/librocksdb\/upstream\",/g' RocksDB.xcodeproj/project.pbxproj;
sed -i "" 's/\"upstream\/include\",/\"\$(SRCROOT)\/Sources\/librocksdb\/upstream\/include\",/g' RocksDB.xcodeproj/project.pbxproj;
sed -i "" 's/\"upstream\/util\"/\"\$(SRCROOT)\/Sources\/librocksdb\/upstream\/util\"/g' RocksDB.xcodeproj/project.pbxproj;
# Run xcodebuild with coverage enabled
xcodebuild test -scheme RocksDB-Package -destination platform="macOS" -enableCodeCoverage YES -derivedDataPath .build/derivedData;
else
swift test;
fi
# Kill background echo job
- kill %1
after_success:
- |
if [ $TRAVIS_OS_NAME == "osx" ]; then
bash <(curl -s https://codecov.io/bash) -J '^RocksDB$' -D .build/derivedData;
fi