-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
110 lines (104 loc) · 2.75 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
language: cpp
sudo: true
dist: trusty
env:
global:
- PATH="$TRAVIS_BUILD_DIR/cmake-download/bin:$PATH"
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- doxygen
- graphviz
env:
- DOCUMENTATION=true
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- libc++-dev
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- DOCUMENTATION=false
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
- libc++-dev
env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
- DOCUMENTATION=false
- os: osx
env:
- DOCUMENTATION=false
branches:
except:
- gh-pages
before_install:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
eval "${MATRIX_EVAL}" &&
mkdir cmake-download && cd cmake-download &&
curl -O https://cmake.org/files/v3.10/cmake-3.10.0-rc5-Linux-x86_64.sh &&
bash cmake-3.10.0-rc5-Linux-x86_64.sh --skip-license &&
cd ..
fi
before_script:
- mkdir build
- cd build
- cmake ..
script:
- |
if [[ "${DOCUMENTATION}" == "true" ]]; then
cd .. &&
( cat doxygen.config ; echo "PROJECT_NUMBER=${TRAVIS_TAG}" ) | doxygen -
else
make
fi
after_success:
- |
if [[ "${DOCUMENTATION}" == "true" ]]; then
pwd &&
zip -r SyDEVS-${TRAVIS_TAG}_api-reference.zip doc/html
else
cd .. &&
pwd &&
export CONTENT_NAME=sydevs-${TRAVIS_TAG} &&
mkdir ${CONTENT_NAME} ${CONTENT_NAME}/lib ${CONTENT_NAME}/include ${CONTENT_NAME}/include/sydevs ${CONTENT_NAME}/include/sydevs/systems ${CONTENT_NAME}/include/sydevs/time ${CONTENT_NAME}/include/sydevs/core &&
cp src/sydevs/core/*.h ${CONTENT_NAME}/include/sydevs/core &&
cp src/sydevs/systems/*.h ${CONTENT_NAME}/include/sydevs/systems &&
cp src/sydevs/time/*.h ${CONTENT_NAME}/include/sydevs/time
cp ${TRAVIS_BUILD_DIR}/**/libSyDEVS*.* ${CONTENT_NAME}/lib &&
cp LICENSE.md ${CONTENT_NAME} &&
export ARCHIVE_NAME=SyDEVS-${TRAVIS_TAG}_${TRAVIS_OS_NAME}_${CC} &&
zip -r ${ARCHIVE_NAME}.zip ${CONTENT_NAME}
mkdir demo
cp -r src/examples/demo/* demo
export DEMO_ARCHIVE_NAME=SyDEVS-${TRAVIS_TAG}_demo-examples &&
zip -r ${DEMO_ARCHIVE_NAME}.zip demo
fi
deploy:
- provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file: ./*.zip
skip_cleanup: true
on:
tags: true
- provider: script
skip_cleanup: true
script: bash scripts/deploy_docs.sh
on:
tags: true
condition: $DOCUMENTATION = true