Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit b3960bd

Browse files
authored
Travis CI configuration. (#7)
1 parent 3eca7ec commit b3960bd

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed

.travis.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
language: objective-c
2+
osx_image: xcode8.2
3+
before_install: true
4+
install: true
5+
git:
6+
submodules: false
7+
branches:
8+
only:
9+
- master
10+
before_script:
11+
- git submodule update --init --recursive
12+
script:
13+
- script/build
14+
xcode_workspace: ReactiveCollections.xcworkspace
15+
matrix:
16+
include:
17+
- xcode_scheme: ReactiveCollections-macOS
18+
env:
19+
- XCODE_SDK=macosx
20+
- XCODE_ACTION="build test"
21+
- XCODE_DESTINATION="arch=x86_64"
22+
- XCODE_PLAYGROUND_TARGET="x86_64-apple-macosx10.10"
23+
- xcode_scheme: ReactiveCollections-iOS
24+
env:
25+
- XCODE_SDK=iphonesimulator
26+
- XCODE_ACTION="build-for-testing test-without-building"
27+
- XCODE_DESTINATION="platform=iOS Simulator,name=iPhone 6s,OS=10.1"
28+
- xcode_scheme: ReactiveCollections-iOS
29+
env:
30+
- XCODE_SDK=iphonesimulator
31+
- XCODE_ACTION="build-for-testing test-without-building"
32+
- XCODE_DESTINATION="platform=iOS Simulator,name=iPhone 5,OS=10.1"
33+
- xcode_scheme: ReactiveCollections-tvOS
34+
env:
35+
- XCODE_SDK=appletvsimulator
36+
- XCODE_ACTION="build-for-testing test-without-building"
37+
- XCODE_DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p"
38+
- xcode_scheme: ReactiveCollections-watchOS
39+
env:
40+
- XCODE_SDK=watchsimulator
41+
- XCODE_ACTION=build
42+
- XCODE_DESTINATION="platform=watchOS Simulator,name=Apple Watch - 38mm"
43+
- script:
44+
- brew update
45+
- brew outdated carthage || brew upgrade carthage
46+
- carthage build --no-skip-current --platform mac
47+
env:
48+
- JOB=CARTHAGE-macOS
49+
- script:
50+
- brew update
51+
- brew outdated carthage || brew upgrade carthage
52+
- carthage build --no-skip-current --platform iOS
53+
env:
54+
- JOB=CARTHAGE-iOS
55+
- script:
56+
- brew update
57+
- brew outdated carthage || brew upgrade carthage
58+
- carthage build --no-skip-current --platform tvOS
59+
env:
60+
- JOB=CARTHAGE-tvOS
61+
- script:
62+
- brew update
63+
- brew outdated carthage || brew upgrade carthage
64+
- carthage build --no-skip-current --platform watchOS
65+
env:
66+
- JOB=CARTHAGE-watchOS
67+
- script:
68+
- gem install cocoapods -v 1.1.1
69+
- pod repo update --silent
70+
- pod lib lint ReactiveCollections.podspec
71+
env:
72+
- JOB=PODSPEC
73+
- os: osx
74+
language: generic
75+
script:
76+
- swift build
77+
env:
78+
- JOB=SWIFTPM_DARWIN
79+
- os: linux
80+
language: generic
81+
sudo: required
82+
dist: trusty
83+
before_install:
84+
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
85+
script:
86+
- mv .Package.test.swift Package.swift
87+
- swift build
88+
- swift test
89+
env: JOB=SWIFTPM_LINUX

script/build

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
3+
# CI build script
4+
#
5+
# https://github.com/ReactiveCocoa/ReactiveSwift/blob/master/script/build
6+
#
7+
# Copyright (c) 2012 - 2016, GitHub, Inc. All rights reserved.
8+
#
9+
# Permission is hereby granted, free of charge, to any person obtaining
10+
# a copy of this software and associated documentation files (the "Software"),
11+
# to deal in the Software without restriction, including without limitation the
12+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
13+
# sell copies of the Software, and to permit persons to whom the Software is
14+
# furnished to do so, subject to the following conditions:
15+
#
16+
# The above copyright notice and this permission notice shall be included in
17+
# all copies or substantial portions of the Software.
18+
#
19+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
# THE SOFTWARE.
26+
27+
BUILD_DIRECTORY="build"
28+
CONFIGURATION=Release
29+
30+
if [[ -z $TRAVIS_XCODE_WORKSPACE ]]; then
31+
echo "Error: \$TRAVIS_XCODE_WORKSPACE is not set."
32+
exit 1
33+
fi
34+
35+
if [[ -z $TRAVIS_XCODE_SCHEME ]]; then
36+
echo "Error: \$TRAVIS_XCODE_SCHEME is not set!"
37+
exit 1
38+
fi
39+
40+
if [[ -z $XCODE_ACTION ]]; then
41+
echo "Error: \$XCODE_ACTION is not set!"
42+
exit 1
43+
fi
44+
45+
if [[ -z $XCODE_SDK ]]; then
46+
echo "Error: \$XCODE_SDK is not set!"
47+
exit 1
48+
fi
49+
50+
if [[ -z $XCODE_DESTINATION ]]; then
51+
echo "Error: \$XCODE_DESTINATION is not set!"
52+
exit 1
53+
fi
54+
55+
set -o pipefail
56+
xcodebuild $XCODE_ACTION \
57+
-workspace "$TRAVIS_XCODE_WORKSPACE" \
58+
-scheme "$TRAVIS_XCODE_SCHEME" \
59+
-sdk "$XCODE_SDK" \
60+
-destination "$XCODE_DESTINATION" \
61+
-derivedDataPath "${BUILD_DIRECTORY}" \
62+
-configuration $CONFIGURATION \
63+
ENABLE_TESTABILITY=YES \
64+
GCC_GENERATE_DEBUGGING_SYMBOLS=NO \
65+
RUN_CLANG_STATIC_ANALYZER=NO | xcpretty
66+
result=$?
67+
68+
if [ "$result" -ne 0 ]; then
69+
exit $result
70+
fi
71+
72+
# Compile code in playgrounds
73+
if [[ $XCODE_SDK = "macosx" ]]; then
74+
echo "SDK is $XCODE_SDK, validating playground..."
75+
. script/validate-playground.sh
76+
fi

script/validate-playground.sh

Whitespace-only changes.

0 commit comments

Comments
 (0)