-
Notifications
You must be signed in to change notification settings - Fork 174
143 lines (125 loc) · 3.93 KB
/
conda-ci.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
name: CONDA
# This determines when this workflow is run
on:
push:
paths-ignore:
- 'doc/**'
- '.gitlab-ci.yml'
- '.gitignore'
- '.pre-commit-config.yaml'
- '*.md'
- 'LICENSE'
- 'pyproject.toml'
- 'package.xml'
- 'dependencies.rosintall'
pull_request:
paths-ignore:
- 'doc/**'
- '.gitlab-ci.yml'
- '.gitignore'
- '.pre-commit-config.yaml'
- '*.md'
- 'LICENSE'
- 'pyproject.toml'
- 'package.xml'
- 'dependencies.rosintall'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
crocoddyl-conda:
name: (${{ matrix.os }}, clang, multi-threading, ipopt, ${{ matrix.build_type }})
runs-on: ${{ matrix.os }}
env:
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 5
strategy:
fail-fast: false
matrix:
# os: ["ubuntu-latest", "macos-latest"]
os: ["macos-latest"]
build_type: [Release, Debug]
python-version: ["3.8", "3.12"]
compiler: [clang]
include:
# - os: ubuntu-latest
- os: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-${{ github.sha }}
restore-keys: ccache-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: crocoddyl
auto-update-conda: true
environment-file: .github/workflows/conda/conda-env.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Install conda dependencies
shell: bash -l {0}
run: |
conda activate crocoddyl
conda install cmake ccache -c conda-forge
conda install llvm-openmp libcxx -c conda-forge
conda list
- name: Install example-robot-data
shell: bash -l {0}
run: |
conda activate crocoddyl
mkdir third-party && cd third-party
git clone --recursive https://github.com/Gepetto/example-robot-data.git
cd example-robot-data && mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
make install
- name: Install compilers for macOS
shell: bash -l {0}
if: contains(matrix.os, 'macos-latest')
run: |
conda install compilers -c conda-forge
- name: Enable CppADCodeGen compilation
shell: bash -l {0}
if: contains(matrix.build_type, 'Release')
run: |
echo "codegen_support=ON" >> "$GITHUB_ENV"
- name: Disable CppADCodeGen compilation
shell: bash -l {0}
if: contains(matrix.build_type, 'Debug')
run: |
echo "codegen_support=OFF" >> "$GITHUB_ENV"
- name: Build Crocoddyl
shell: bash -l {0}
run: |
conda activate crocoddyl
echo $CONDA_PREFIX
mkdir build
cd build
cmake .. \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_WITH_CODEGEN_SUPPORT=${{ env.codegen_support }} -DPYTHON_EXECUTABLE=$(which python3) \
-DBUILD_WITH_MULTITHREADS=ON -DINSTALL_DOCUMENTATION=ON -DOpenMP_ROOT=$CONDA_PREFIX
make
- name: Run unit tests
shell: bash -l {0}
run: |
conda activate crocoddyl
cd build
export CTEST_OUTPUT_ON_FAILURE=1
make test
- name: Install Crocoddyl
shell: bash -l {0}
run: |
cd build
make install
- name: Uninstall Crocoddyl
shell: bash -l {0}
run: |
cd build
make uninstall