-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
80 lines (74 loc) · 2 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
language: minimal
os:
- linux
- osx
sudo: required
osx_image: xcode10
services:
- docker
env:
global:
- Repo=davidskrundz/swift
- UBUNTU_VERSIONS=14.04,16.04,18.04
matrix:
- SWIFT_VERSION=4.2
install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
fi
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]
then
case `echo $SWIFT_VERSION | grep -o "\." | grep -c "\."` in
0) Swift=$SWIFT_VERSION.0.0 ;;
1) Swift=$SWIFT_VERSION.0 ;;
2) Swift=$SWIFT_VERSION ;;
esac
for Ubuntu in `echo $UBUNTU_VERSIONS | tr ',' '\n'`
do
docker pull $Repo:$Swift-$Ubuntu
done
fi
script:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
swift test
fi
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]
then
for Ubuntu in `echo $UBUNTU_VERSIONS | tr ',' '\n'`
do
docker run --volume `pwd`:/code --workdir /code $Repo:$Swift-$Ubuntu swift test
done
fi
matrix:
include:
- os: osx
env:
install:
- gem install xcpretty-travis-formatter
script:
- |
PROJ_OUTPUT=`swift package generate-xcodeproj --enable-code-coverage`
PROJ_OUTPUT=`swift package generate-xcodeproj --enable-code-coverage`
PROJ_NAME="${PROJ_OUTPUT/generated: .\//}"
SCHEME_NAME="${PROJ_NAME/.xcodeproj/}-Package"
MACOS_SDK=`xcodebuild -showsdks | grep macos | tail -n 1 | awk 'NF>1{print $NF}'`
WORKING_DIRECTORY=$(PWD) xcodebuild \
-project $PROJ_NAME \
-scheme $SCHEME_NAME \
-sdk $MACOS_SDK \
-destination arch=x86_64 \
-configuration Debug \
-enableCodeCoverage YES \
test | xcpretty -f `xcpretty-travis-formatter`
after_success:
- |
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]
then
bash <(curl -s https://codecov.io/bash)
fi