-
Notifications
You must be signed in to change notification settings - Fork 49
243 lines (214 loc) · 9.84 KB
/
ci-linux-osx-win-conda.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: CI - Linux/OSX/Windows - Conda
on:
push:
pull_request:
jobs:
build-with-conda:
name: '[conda:${{ matrix.os }}:${{ matrix.build_type }}:c++${{ matrix.cxx_std }}]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
name: [ubuntu-latest, macos-latest, windows-2019-clang-cl, windows-latest, macos-14]
cxx_std: [17, 20]
continue_on_error: [false]
include:
- name: ubuntu-latest
os: ubuntu-latest
- name: macos-latest
os: macos-latest
- name: macos-14
os: macos-14
- name: windows-2019-clang-cl
os: windows-2019
compiler: clang-cl
- name: windows-latest
os: windows-latest
- name: macos-latest
os: macos-latest
build_type: Release
cxx_std: 14
- name: macos-latest
os: macos-latest
build_type: Debug
cxx_std: 17
continue_on_error: true
- name: macos-latest
os: macos-latest
build_type: Debug
cxx_std: 20
continue_on_error: true
exclude:
- name: macos-latest
build_type: Debug
cxx_std: 17
continue_on_error: false
- name: macos-latest
build_type: Debug
cxx_std: 20
continue_on_error: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: conda-incubator/setup-miniconda@v2
if: matrix.os != 'macos-14'
with:
miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge
python-version: "3.10"
activate-environment: proxsuite
- uses: conda-incubator/setup-miniconda@v3
if: matrix.os == 'macos-14'
with:
channels: conda-forge
python-version: "3.10"
activate-environment: proxsuite
installer-url: https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh
- name: Install dependencies [Conda]
shell: bash -l {0}
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 pkg-config doxygen ninja graphviz typing_extensions
# Main dependencies
mamba install eigen simde
# Test dependencies
mamba install libmatio numpy scipy
- name: Install julia [macOS/Linux]
if: contains(matrix.os, 'macos-latest') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
mamba install julia
- name: Activate ccache [Conda]
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-${{ matrix.type }}-${{ matrix.cxx_std }}
max-size: 1G
- name: Print environment [Conda]
shell: bash -l {0}
run: |
conda info
mamba list
env
- name: Configure [Conda/Linux&macOS]
if: contains(matrix.os, 'macos-latest') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
echo $(whereis ccache)
echo $(which ccache)
git submodule update --init
mkdir build
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON -DTEST_JULIA_INTERFACE:BOOL=ON -DOpenMP_ROOT=$CONDA_PREFIX
- name: Configure [Conda/macOS14]
if: contains(matrix.os, 'macos-14')
shell: bash -l {0}
run: |
echo $(whereis ccache)
echo $(which ccache)
git submodule update --init
mkdir build
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON -DTEST_JULIA_INTERFACE:BOOL=OFF -DOpenMP_ROOT=$CONDA_PREFIX
- name: Configure [Conda/macOS-debug/CheckMalloc]
if: contains(matrix.os, 'macos-latest') && contains(matrix.build_type, 'Debug')
shell: bash -l {0}
run: |
echo $(whereis ccache)
echo $(which ccache)
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCHECK_RUNTIME_MALLOC:BOOL=ON -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON -DTEST_JULIA_INTERFACE:BOOL=ON -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DOpenMP_ROOT=$CONDA_PREFIX
- name: Configure [Conda/Windows-2019]
if: contains(matrix.os, 'windows-2019')
shell: bash -l {0}
run: |
echo $(where ccache)
ls C:\\Miniconda3\\envs\\proxsuite\\Library\\lib
git submodule update --init
mkdir build
cd build
cmake .. -G"Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_SITELIB=${CONDA_PREFIX}/Lib/site-packages -DPYTHON_EXECUTABLE=${CONDA_PREFIX}/python.exe -DOpenMP_ROOT=$CONDA_PREFIX -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON
- name: Configure [Conda/Windows-latest]
if: contains(matrix.os, 'windows-latest') && contains(matrix.cxx_std, '20')
shell: bash -l {0}
run: |
echo $(where ccache)
ls C:\\Miniconda3\\envs\\proxsuite\\Library\\lib
git submodule update --init
mkdir build
cd build
cmake .. -G"Visual Studio 17 2022" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_SITELIB=${CONDA_PREFIX}/Lib/site-packages -DPYTHON_EXECUTABLE=${CONDA_PREFIX}/python.exe -DOpenMP_ROOT=$CONDA_PREFIX -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON
- name: Configure [Conda/Windows-latest]
if: contains(matrix.os, 'windows-latest') && contains(matrix.cxx_std, '17')
shell: bash -l {0}
run: |
echo $(where ccache)
ls C:\\Miniconda3\\envs\\proxsuite\\Library\\lib
git submodule update --init
mkdir build
cd build
cmake .. -G"Visual Studio 17 2022" -T "v143" -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_SITELIB=${CONDA_PREFIX}/Lib/site-packages -DPYTHON_EXECUTABLE=${CONDA_PREFIX}/python.exe -DOpenMP_ROOT=$CONDA_PREFIX -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON
- name: Build [Conda]
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -v -j 1
- name: Build documentation [Conda]
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target doc
- name: Install [Conda]
shell: bash -l {0}
run: |
cd build
cmake --install . --config ${{ matrix.build_type }}
- name: Test [Conda]
continue-on-error: ${{ matrix.continue_on_error }}
shell: bash -l {0}
run: |
find $CONDA_PREFIX -name proxsuite*
python -c "import proxsuite"
cd build
ctest --output-on-failure -C ${{ matrix.build_type }}
# - name: Test pkg-config [Conda]
# shell: bash -l {0}
# run: |
# cd build
# export PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig
# pkg-config --cflags proxsuite
# g++ -std=c++17 examples/cpp/overview-simple.cpp -o overview-simple $(pkg-config --cflags proxsuite)
# ./overview-simple
- name: Test CMake packaging [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
cd test/packaging/cmake
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DPACKAGE_PREFIX_DIR=${CONDA_PREFIX}
cmake --build . --config ${{ matrix.build_type }} --target all
./run-proxqp
- name: Uninstall [Conda]
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target uninstall
- name: Display ccache statistics [Conda]
shell: bash -l {0}
run: |
echo $(ccache -s)
check:
if: always()
name: check-ci-linux-osx-win-conda
needs:
- build-with-conda
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}