...cleaning #317
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |