-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
112 lines (106 loc) · 4.01 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
111
112
language: cpp
matrix:
include:
- os: linux
dist: xenial
language: python
compiler: gcc
python: "3.7"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- COMPILER_NAME=gcc-7
- BUILD_TYPE=Release
- CONAN_BUILD_TYPE=Release
- COMPILER_LIBCXX=libstdc++11
- GTEST_VERSION=1.8.1
- os: linux
dist: xenial
language: python
compiler: gcc
python: "3.7"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- COMPILER_NAME=gcc-7
- BUILD_TYPE=Debug
- CONAN_BUILD_TYPE=Debug
- COMPILER_LIBCXX=libstdc++11
- GTEST_VERSION=1.8.1
- os: osx
osx_image: xcode12.2
language: cpp
compiler: clang
env:
- COMPILER_NAME=clang-MacOS
- BUILD_TYPE=Release
- CONAN_BUILD_TYPE=Release
- COMPILER_LIBCXX=libc++
- GTEST_VERSION=1.8.1
- HOMEBREW_NO_AUTO_UPDATE=1
cache:
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
install:
- if [ $TRAVIS_OS_NAME == linux ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90; fi
- if [ $TRAVIS_OS_NAME == linux ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90; fi
- if [ $TRAVIS_OS_NAME == linux ]; then pip install conan; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew install conan; fi
- conan user
- conan remote add systelab-public https://csw.jfrog.io/artifactory/api/conan/cpp-conan-production-local --insert 0
- conan --version
script:
- g++ --version
- |
if [ -n "$TRAVIS_TAG" ]; then
conan export-pkg JSONAdapterInterface/conanfile.py "JSONAdapterInterface/${TRAVIS_TAG:1}@systelab/stable" -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX};
else
conan export-pkg JSONAdapterInterface/conanfile.py "JSONAdapterInterface/0.0.${TRAVIS_BUILD_NUMBER}@systelab/stable" -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX};
fi
- mkdir -p build
- cd build
- |
if [ -n "$TRAVIS_TAG" ]; then
conan install ../JSONAdapterTestUtilities -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX} -o gtest=${GTEST_VERSION} -e VERSION="${TRAVIS_TAG:1}";
else
conan install ../JSONAdapterTestUtilities -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX} -o gtest=${GTEST_VERSION} -e VERSION="0.0.${TRAVIS_BUILD_NUMBER}";
fi
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make
- |
if [ -n "$TRAVIS_TAG" ]; then
conan export-pkg ../JSONAdapterTestUtilities/conanfile.py "JSONAdapterTestUtilities/${TRAVIS_TAG:1}@systelab/stable" -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX} -o gtest=${GTEST_VERSION};
else
conan export-pkg ../JSONAdapterTestUtilities/conanfile.py "JSONAdapterTestUtilities/0.0.${TRAVIS_BUILD_NUMBER}@systelab/stable" -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX} -o gtest=${GTEST_VERSION};
fi
- |
if [ "$BUILD_TYPE" == "Release" ] || [ "$BUILD_TYPE" == "Debug" ]; then
if [ -n "$TRAVIS_TAG" ]; then
conan test ../test_package/conanfile.py JSONAdapterTestUtilities/${TRAVIS_TAG:1}@systelab/stable -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX} -o gtest=${GTEST_VERSION};
else
conan test ../test_package/conanfile.py JSONAdapterTestUtilities/0.0.${TRAVIS_BUILD_NUMBER}@systelab/stable -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${COMPILER_LIBCXX} -o gtest=${GTEST_VERSION};
fi
fi
- cd ..
deploy:
- provider: script
skip_cleanup: true
script: bash ./ci/deploy.sh -v "${TRAVIS_TAG:1}"
on:
tags: true
- provider: script
script: bash ./ci/build_docs.sh -o "systelab" -s "cpp-json-adapter" -t "${TRAVIS_TAG}" -c "Travis" -n "${COMPILER_NAME} ${BUILD_TYPE}" -j "${TRAVIS_JOB_ID}"
skip_cleanup: true
on:
tags: true