forked from pyomeca/biorbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
153 lines (140 loc) · 5.78 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
language: cpp
matrix:
include:
- os: linux
dist: bionic
compiler: gcc
env:
- COMPILER=gcc
- os: osx
osx_image: xcode7.2
compiler: gcc
env:
- COMPILER=xcode7.2
- os: windows
before_install:
# Combine global build options with OS/compiler-dependent options
- export CMAKE_OPTIONS=${CMAKE_OPTIONS}" "${ENV_CMAKE_OPTIONS}
- export CXX_FLAGS=${CXX_FLAGS}" "${ENV_CXX_FLAGS}
# Add stuff for Python3 tests as well
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
choco install miniconda3 --params="'/AddToPath:1'";
export PATH="/c/tools/miniconda3/scripts:/c/tools/miniconda3/:/c/Program Files/Git/miniconda3/bin/:$PATH";
fi
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda config --set auto_update_conda no
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then conda update -q conda; fi
- source activate
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y;
sudo apt update;
sudo apt install gcc-6 g++-6 -y;
fi
install:
- conda create -n biorbd_eigen
- conda activate biorbd_eigen
- conda install rbdl tinyxml numpy pytest swig pkgconfig -c conda-forge
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
conda install ipopt -c conda-forge;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
conda install lcov cmake -c conda-forge;
fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
conda create -n biorbd_casadi;
conda deactivate;
conda activate biorbd_casadi;
conda install rbdl=*=*casadi* tinyxml pkgconfig ipopt -c conda-forge;
conda deactivate;
fi
script:
############################################################################
# Build main and tests
############################################################################
# Test the casadi backend
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
conda deactivate;
conda activate biorbd_casadi
cd ..;
mkdir build_casadi;
cd build_casadi;
cmake ${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=$HOME/miniconda/envs/biorbd_casadi/ -DCMAKE_CXX_FLAGS=${CXX_FLAGS} -DMATH_LIBRARY_BACKEND="Casadi" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DMODULE_ACTUATORS=ON -DMODULE_MUSCLES=ON ..;
make install;
cd test;
./biorbd_tests;
cd ../../;
conda deactivate;
fi
# Download, compile and test core
- conda activate biorbd_eigen
- mkdir -p build_eigen
- cd build_eigen
# Perform tests on all platform, but only perform code coverage on Linux
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
cmake -G"Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=/c/tools/miniconda3/envs/biorbd_eigen/ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DBUILD_EXAMPLE=ON -DMODULE_ACTUATORS=ON -DMODULE_MUSCLES=ON -DBINDER_C=ON -DBINDER_PYTHON3=ON ..;
cmake --build ./ --config Release --target install;
else
cmake ${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=$HOME/miniconda/envs/biorbd_eigen/ -DCMAKE_CXX_FLAGS=${CXX_FLAGS} -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DBUILD_EXAMPLE=ON -DMODULE_ACTUATORS=ON -DMODULE_MUSCLES=ON -DBINDER_C=ON -DBINDER_PYTHON3=ON ..;
make install;
fi
# Move and copy mandatory files and run the tests for all platforms
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
cd test\\Release;
xcopy ..\\models .\\models\\;
xcopy ..\\models\\meshFiles .\\models\\meshFiles\\;
xcopy ..\\models\\meshFiles\\vtp .\\models\\meshFiles\\vtp\\;
./biorbd_tests.exe;
else
cd test;
./biorbd_tests;
fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
xcopy ..\\binding\\c\\Release\\biorbd_tests_binding_c.exe;
xcopy ..\\..\\binding\\c\\Release\\*.dll;
./biorbd_tests_binding_c.exe;
else
cd binding/c;
./biorbd_tests_binding_c;
fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
cd ../..;
else
cd ../../..;
fi
# Test if biorbd can be compile on the python binder
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
cd test\\binding\\Python3;
else
cd test/binding/Python3;
fi
- pytest test_binder_python_rigidbody.py
- cd ../../..
# Only do the coverage on Linux, but run the test anyway to get a nice output
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
cmake ${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=$HOME/miniconda/envs/biorbd_eigen/ -DCMAKE_CXX_FLAGS=${CXX_FLAGS} -DCMAKE_BUILD_TYPE=Coverage -DBUILD_TESTS=ON -DBUILD_EXAMPLE=OFF -DMODULE_ACTUATORS=ON -DMODULE_MUSCLES=ON -DBINDER_C=OFF ..;
make;
cp -r test/models/ .;
make biorbd_coverage;
fi
- ctest
after_success:
# Uploading report to CodeCov
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
cd ${TRAVIS_BUILD_DIR};
lcov --directory . --capture --output-file coverage.info;
lcov --remove coverage.info '/usr/*' --output-file coverage.info;
lcov --list coverage.info;
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports";
fi
notifications:
email:
on_success: never
on_failure: always