-
Notifications
You must be signed in to change notification settings - Fork 60
209 lines (183 loc) · 7.22 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
name: CI - Linux/OSX/Windows - Conda
on:
push:
pull_request:
paths-ignore:
- CHANGELOG.md
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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
# proxsuite doesn't build with vs2019, so we use clang-cl instead
- name: windows-2019-clang-cl
os: windows-2019
compiler: clang-cl
# proxsuite should work with vs2022
- name: windows-latest
os: windows-latest
compiler: cl
- 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@v3
with:
activate-environment: proxsuite
environment-file: .github/workflows/conda/environment.yml
auto-activate-base: false
auto-update-conda: true
- name: Install dependencies [Conda/Windows-latest]
if: contains(matrix.os, 'windows-latest')
shell: bash -l {0}
run: |
# Use VS2022 on Windows-latest
conda install vs2022_win-64
- name: Install julia [Linux]
if: contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
conda install julia
- name: Activate ccache [Conda]
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.type }}-${{ matrix.cxx_std }}
max-size: 1G
- name: Print environment [Conda]
shell: bash -l {0}
run: |
conda info
conda list
env
- name: Configure [Conda/Linux&macOS]
if: contains(matrix.os, 'macos-') || 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=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=OFF -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DOpenMP_ROOT=$CONDA_PREFIX
- name: Configure [Conda/Windows]
if: contains(matrix.os, 'windows-')
# It's better to use CMD to have all VS variables setup
shell: cmd /C CALL {0}
run: |
git submodule update --init
mkdir build
cd build
set CC=${{ matrix.compiler }}
set CXX=${{ matrix.compiler }}
cmake .. -GNinja -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/Linux&macOS]
if: contains(matrix.os, 'macos-') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -v -j 1
- name: Build [Conda/Windows]
if: contains(matrix.os, 'windows-')
# It's better to use CMD to have all VS variables setup
shell: cmd /C CALL {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) }}