-
Notifications
You must be signed in to change notification settings - Fork 1
192 lines (166 loc) · 5.21 KB
/
ci_splitted.yaml
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
name: build
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unix:
strategy:
matrix:
os: ["ubuntu-latest","macos-latest"]
build_type: ["Release"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Install Conda environment from environment.yml
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
- name: cmake configure
shell: bash -l {0}
run: |
mkdir -p bld
cd bld
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_TESTS=ON \
-DBUILD_SINGLE_BINARY_TESTS=ON \
-DBUILD_PYTHON_BINDINGS=ON \
-DBUILD_DOCS=ON \
-DBUILD_PLUGINS=OFF \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
- name: Build
shell: bash -l {0}
run: |
cd bld
make -j ${{ steps.cpu-cores.outputs.count }}
- name: install
shell: bash -l {0}
run: |
cd bld
make install
- name: build all plugins
shell: bash -l {0}
run: |
SHARED_LIB_EXT=so
if [ "$(uname)" == "Darwin" ]; then
SHARED_LIB_EXT=dylib
fi
set -e
cd src/nxtgm/plugins/
# loop over all subdirectories / plugin types
# ie discrete_gm_optimizer, proposal_gen, ...
for plugin_type_dir in */ ; do
echo "building plugins of type:" $plugin_type_dir
pushd $plugin_type_dir
# loop over all concrete plugins
for plugin_impl in */ ; do
echo "building" $plugin_impl
pushd $plugin_impl
mkdir -p bld
pushd bld
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DHIGHS_LIBRARY=$CONDA_PREFIX/lib/libhighs.$SHARED_LIB_EXT \
-DHIGHS_INCLUDE_DIR=$CONDA_PREFIX/include/highs
make -j ${{ steps.cpu-cores.outputs.count }}
make install
popd
popd
done
popd
done
- name: run installed tests
if : ${{ matrix.os == 'ubuntu-latest' }}
shell: bash -l {0}
run: |
nxtgm_test_all --tce="ilp*"
- name: run installed tests
if : ${{ matrix.os == 'macos-latest' }}
shell: bash -l {0}
run: |
nxtgm_test_all
windows:
strategy:
matrix:
os: [windows-latest]
build_type: ["Release", "Debug"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Conda environment from environment.yml
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment_win.yml
init-shell: >-
cmd.exe
cache-environment: true
post-cleanup: 'all'
- name: build and test
shell: cmd /C CALL {0}
run: |
mkdir bld
cd bld
set PATH=%PATH%;%CD%
cmake .. ^
-G Ninja ^
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
-DBUILD_TESTS=ON ^
-DBUILD_SINGLE_BINARY_TESTS=ON ^
-DBUILD_PYTHON_BINDINGS=ON ^
-DBUILD_DOCS=OFF ^
-DBUILD_PLUGINS=OFF ^
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%
cmake --build . --config ${{ matrix.build_type }}
cmake --install . --config ${{ matrix.build_type }}
- name: build all plugins
shell: cmd /C CALL {0}
run: |
cd src\nxtgm\plugins
# loop over all subdirectories / plugin types
# ie discrete_gm_optimizer, proposal_gen, ...
for /D %%d in (*) do (
echo "building plugins of type:" %%d
# skip if plugin type is ilp
if %%d == ilp (
echo "skipping ilp plugins"
continue
)
cd %%d
# loop over all concrete plugins
for /D %%p in (*) do (
echo "building" %%p
cd %%p
# skip if name is ilp based
if %%p == ilp_* (
echo "skipping ilp plugin"
cd ..
continue
)
mkdir bld
cd bld
cmake .. ^
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%
cmake --build . --config ${{ matrix.build_type }}
cmake --install . --config ${{ matrix.build_type }}
cd ..\..
)
cd ..
)
- name: run installed tests
shell: cmd /C CALL {0}
run: |
nxtgm_test_all