-
Notifications
You must be signed in to change notification settings - Fork 67
118 lines (100 loc) · 4.29 KB
/
matlab.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
name: MATLAB Tests Workflow
on:
push:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
- cron: '0 2 * * *'
jobs:
build-matlab-tests:
name: '[matlab:${{ matrix.matlab_version }}:${{ matrix.os }}]'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os: [ubuntu-20.04, windows-2019, macos-12]
matlab_version: [R2022a, R2022b, R2023a]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge,robotology
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: ${{ matrix.matlab_version }}
- name: Dependencies
run: |
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
conda config --remove channels defaults
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config
# Actual dependencies
mamba install eigen libxml2 assimp ipopt irrlicht osqp-eigen glfw
# Additional dependencies useful only on Linux
- name: Dependencies [Conda/Linux]
if: contains(matrix.os, 'ubuntu')
run: |
# Additional dependencies only useful on Linux
# See https://github.com/robotology/robotology-superbuild/issues/477
mamba install xorg-libx11 xorg-libxrandr freeglut mesa-libgl-cos6-x86_64 mesa-libgl-devel-cos6-x86_64
# Additional dependencies useful only on Windows
- name: Dependencies [Conda/Windows]
if: contains(matrix.os, 'windows')
run: |
# Additional dependencies only useful on Windows
# See https://github.com/robotology/robotology-superbuild/issues/477
mamba install vs2019_win-64
# Workaround for https://github.com/robotology/idyntree/issues/1109
- name: Dependencies [Conda/macOS]
if: contains(matrix.os, 'macos')
run: |
mamba install libblas=*=*netlib
# workaround for https://github.com/robotology/robotology-superbuild/issues/64
# and https://github.com/robotology/idyntree/issues/995
- name: Do not use MATLAB's stdc++ to avoid incompatibilities with other libraries
if: contains(matrix.os, 'ubuntu')
run:
echo "LD_PRELOAD=${CONDA_PREFIX}/lib/libstdc++.so.6" >> $GITHUB_ENV
- name: Print used environment [Conda]
shell: bash -l {0}
run: |
mamba list
env
- name: Configure [Conda - Linux or macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
run: |
mkdir build
cd build
cmake -GNinja -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DMATLAB_FIND_DEBUG:BOOL=ON -DIDYNTREE_USES_MATLAB:BOOL=ON -DBUILD_TESTING:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=OFF -DIDYNTREE_USES_ICUB_MAIN:BOOL=OFF -DIDYNTREE_USES_OSQPEIGEN:BOOL=ON ..
- name: Configure [Conda - Windows]
if: contains(matrix.os, 'windows')
run: |
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DMATLAB_FIND_DEBUG:BOOL=ON -DIDYNTREE_USES_MATLAB:BOOL=ON -DBUILD_TESTING:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=OFF -DIDYNTREE_USES_ICUB_MAIN:BOOL=OFF -DIDYNTREE_USES_OSQPEIGEN:BOOL=ON ..
- name: Build
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Inspect libraries linked by iDynTreeMEX.mexa64 [Conda/Linux]
if: contains(matrix.os, 'ubuntu')
run: |
cd build
ldd ./lib/iDynTreeMEX.mexa64
- name: Test [Conda]
run: |
cd build
# Only run matlab tests as the rest of tests are already run by other jobs
ctest --output-on-failure -C ${{ matrix.build_type }} -R "matlab" -VV .
- name: Install [Conda]
run: |
cd build
cmake --install . --config ${{ matrix.build_type }}