forked from pyomeca/biorbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.appveyor.yml
178 lines (143 loc) · 7.64 KB
/
.appveyor.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#---------------------------------#
# environment configuration #
#---------------------------------#
# Build worker image (VM template)
image:
- Ubuntu2004
- Visual Studio 2019
- macos
# set clone depth
clone_depth: 5 # clone entire repository history if not defined
# There is no building process
build: off
# scripts that run after cloning repository
install:
- sh: if [[ $CI_LINUX == true ]]; then sudo apt install lcov -y; fi
- sh: if [[ $CI_LINUX == true ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 1000 --slave /usr/bin/g++ g++ /usr/bin/g++-9; fi
- sh: if [[ $CI_LINUX == true ]]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; bash miniconda.sh -b -p $HOME/miniconda; export PATH="$HOME/miniconda/bin:$PATH"; else curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -L -o miniconda.sh; bash miniconda.sh -b -p $HOME/miniconda; export PATH="$HOME/miniconda/bin:$PATH"; fi
- sh: hash -r
- sh: source activate
- cmd: SET MINICONDA_PATH="C:\\Miniconda38-x64"
- cmd: SET PATH=%MINICONDA_PATH%;%MINICONDA_PATH%"\\Scripts";%PATH%
- cmd: conda init cmd.exe
- conda config --set always_yes yes --set changeps1 no
- conda config --set auto_update_conda no
- conda update -q conda
- conda create -n biorbd
- conda activate biorbd
# Set environment variables
- sh: BIORBD_FOLDER=`pwd`
- sh: BIORBD_CASADI_BUILD_FOLDER=$BIORBD_FOLDER/build_casadi
- sh: BIORBD_EIGEN_BUILD_FOLDER=$BIORBD_FOLDER/build_eigen
- sh: BIORBD_COVERAGE_BUILD_FOLDER=$BIORBD_FOLDER/build_coverage
- sh: CONDA_ENV_PATH=$HOME/miniconda/envs
- sh: if [[ $CI_LINUX == true ]]; then export CC=/usr/bin/gcc; fi
- sh: if [[ $CI_LINUX == true ]]; then export CXX=/usr/bin/g++; fi
- cmd: SET BIORBD_FOLDER=%cd%
- cmd: SET BIORBD_CASADI_BUILD_FOLDER=%BIORBD_FOLDER%\\build_casadi
- cmd: SET BIORBD_EIGEN_BUILD_FOLDER=%BIORBD_FOLDER%\\build_eigen
- cmd: SET CONDA_ENV_PATH=%MINICONDA_PATH%\\envs
# Setup the conda environment
- conda install git rbdl tinyxml ipopt numpy pytest swig pkgconfig cmake scipy -c conda-forge
- sh: if [[ $CI_LINUX == true ]]; then conda install xorg-libx11 xorg-libxtst -cconda-forge; fi
- cmd: conda install ninja -cconda-forge
- conda list
test_script:
############################################################################
# Test the Casadi backend
############################################################################
- sh: cd $BIORBD_FOLDER
- cmd: cd %BIORBD_FOLDER%
# LINUX and MAC
- sh: mkdir -p $BIORBD_CASADI_BUILD_FOLDER
- sh: cd $BIORBD_CASADI_BUILD_FOLDER
- sh: cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH/biorbd/ -DMATH_LIBRARY_BACKEND="Casadi" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DMODULE_ACTUATORS=ON -DMODULE_KALMAN=OFF -DMODULE_MUSCLES=ON -DBINDER_PYTHON3=ON ..
- sh: make install
# WINDOWS
- cmd: mkdir %BIORBD_CASADI_BUILD_FOLDER%
- cmd: cd %BIORBD_CASADI_BUILD_FOLDER%
- cmd: cmake -GNinja -DCMAKE_INSTALL_PREFIX=%CONDA_ENV_PATH%/biorbd/ -DMATH_LIBRARY_BACKEND="Casadi" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DMODULE_ACTUATORS=ON -DMODULE_KALMAN=OFF -DMODULE_MUSCLES=ON -DBINDER_PYTHON3=ON ..
- cmd: cmake --build . --config Release --target install
# Run the tests
- cd test
- sh: ./biorbd_casadi_tests
- cmd: biorbd_casadi_tests.exe
- cd ..
############################################################################
# Test the Eigen3 backend
############################################################################
- sh: cd $BIORBD_FOLDER
- cmd: cd %BIORBD_FOLDER%
# LINUX and MAC
- sh: mkdir -p $BIORBD_EIGEN_BUILD_FOLDER
- sh: cd $BIORBD_EIGEN_BUILD_FOLDER
- sh: cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH/biorbd/ -DMATH_LIBRARY_BACKEND="Eigen3" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DMODULE_ACTUATORS=ON -DMODULE_KALMAN=ON -DMODULE_MUSCLES=ON -DBUILD_EXAMPLE=ON -DBINDER_C=ON -DBINDER_PYTHON3=ON ..
- sh: make install
# WINDOWS
- cmd: mkdir %BIORBD_EIGEN_BUILD_FOLDER%
- cmd: cd %BIORBD_EIGEN_BUILD_FOLDER%
- cmd: cmake -GNinja -DCMAKE_INSTALL_PREFIX=%CONDA_ENV_PATH%\\biorbd -DMATH_LIBRARY_BACKEND="Eigen3" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DMODULE_ACTUATORS=ON -DMODULE_KALMAN=ON -DMODULE_MUSCLES=ON -DBUILD_EXAMPLE=ON -DBINDER_C=ON -DBINDER_PYTHON3=ON ..
- cmd: cmake --build . --config Release --target install
# Run the tests
- cd test
- sh: ./biorbd_eigen_tests
- cmd: biorbd_eigen_tests.exe
- cd ..
# Test the c binder
- cd test/binding/c
- sh: ./biorbd_eigen_tests_binding_c
- cmd: biorbd_eigen_tests_binding_c.exe
- cd ../../..
############################################################################
# Test for the python binder (both casadi and eigen)
############################################################################
- cd test/binding/Python3
- pytest .
- cd ../../..
############################################################################
# Code coverage (on Linux)
############################################################################
- sh: if [[ $CI_LINUX == true ]]; then cd $BIORBD_FOLDER; mkdir $BIORBD_COVERAGE_BUILD_FOLDER; cd $BIORBD_COVERAGE_BUILD_FOLDER; fi
- sh: if [[ $CI_LINUX == true ]]; then cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH/biorbd/ -DCMAKE_BUILD_TYPE=Coverage -DBUILD_TESTS=ON -DBUILD_EXAMPLE=OFF -DMODULE_ACTUATORS=ON -DMODULE_MUSCLES=ON -DMODULE_KALMAN=ON ..; fi
- sh: if [[ $CI_LINUX == true ]]; then cp -r test/models/ .; fi
- sh: if [[ $CI_LINUX == true ]]; then make biorbd_eigen_coverage; fi
- sh: if [[ $CI_LINUX == true ]]; then cd $BIORBD_EIGEN_BUILD_FOLDER; fi
############################################################################
# Test installation (cpp_casadi_installed folder)
############################################################################
- sh: cd $BIORBD_FOLDER/examples/cpp_casadi_installed
- cmd: cd %BIORBD_FOLDER%\\examples\\cpp_casadi_installed
- mkdir build
- cd build
# LINUX and Mac
- sh: cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH/biorbd/ -DCMAKE_BUILD_TYPE=Release ..
- sh: make
- sh: ./forwardDynamicsExample
# WINDOWS
- cmd: cmake -GNinja -DCMAKE_INSTALL_PREFIX=%CONDA_ENV_PATH%\\biorbd -DCMAKE_BUILD_TYPE=Release ..
- cmd: cmake --build . --config Release
- cmd: forwardDynamicsExample.exe
- sh: cd $BIORBD_FOLDER
- cmd: cd %BIORBD_FOLDER%
############################################################################
# Test installation (cpp_eigen_installed folder)
############################################################################
- sh: cd $BIORBD_FOLDER/examples/cpp_eigen_installed
- cmd: cd %BIORBD_FOLDER%\\examples\\cpp_eigen_installed
- mkdir build
- cd build
# LINUX and Mac
- sh: cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH/biorbd/ -DCMAKE_BUILD_TYPE=Release ..
- sh: make
- sh: ./forwardDynamicsExample
# WINDOWS
- cmd: cmake -GNinja -DCMAKE_INSTALL_PREFIX=%CONDA_ENV_PATH%\\biorbd -DCMAKE_BUILD_TYPE=Release ..
- cmd: cmake --build . --config Release
- cmd: forwardDynamicsExample.exe
- sh: cd $BIORBD_FOLDER
- cmd: cd %BIORBD_FOLDER%
on_success:
# Uploading report to CodeCov
- sh: if [[ $CI_LINUX == true ]]; then cd $BIORBD_COVERAGE_BUILD_FOLDER; fi
- sh: if [[ $CI_LINUX == true ]]; then 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
- sh: if [[ $CI_LINUX == true ]]; then cd $BIORBD_FOLDER; fi