-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
64 lines (51 loc) · 1.97 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
language: cpp
services: docker
git:
submodules: false
env:
global:
- AUDIODEV=null
matrix:
include:
# OSX builds
- os: osx
compiler: clang
env: CROSS_BUILD=0 BUILD_TYPE=debug
sudo: required
- os: osx
compiler: clang
env: CROSS_BUILD=0 BUILD_TYPE=release
sudo: required
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sed -i '' 's/[email protected]:/https:\/\/github.com\//' .gitmodules; fi
- git submodule update --init --recursive
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install tinyxml sdl2 openal-soft; fi
install:
- mkdir build && cd build
# Never build samples on Travis, it's too slow
- export SIMULANT_OPTIONS="-DSIMULANT_BUILD_SAMPLES=OFF"
# If releasing, then do a release build (default is debug)
- if [[ "$BUILD_TYPE" == "release" ]]; then export SIMULANT_OPTIONS="$SIMULANT_OPTIONS -DCMAKE_BUILD_TYPE=Release"; fi
# If we're not cross-compiling, then do a normal make dance
- if [[ "$CROSS_BUILD" == "0" ]]; then cmake $SIMULANT_OPTIONS ..; fi
- if [[ "$CROSS_BUILD" == "0" ]]; then make; fi
script:
# Run the tests
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./tests/simulant_tests; fi;
# Package everything into a folder for upload to GCS
- if [[ "$CROSS_BUILD" == "0" ]]; then export BUILD_TARGET=$TRAVIS_OS_NAME; fi;
- cd $TRAVIS_BUILD_DIR
# On most platforms, we package, but we don't upload. We leave that to the deploy section
- if [[ "$CROSS_BUILD" == "0" ]]; then mkdir $BUILD_TARGET && ./platforms/package.py --build-type=$BUILD_TYPE --build-target=$BUILD_TARGET --target-folder=$TRAVIS_BUILD_DIR/$BUILD_TARGET --header-folder=./simulant --lib-folder=./build --package-only; fi;
deploy:
provider: gcs
bucket: staging.simulant-engine.appspot.com
acl: public-read
local-dir: $BUILD_TARGET
skip_cleanup: true
access_key_id: $GCS_ACCESS_KEY
secret_access_key: $GCS_SECRET
on:
branch: master
condition: $CROSS_BUILD = "0"