Add support for CPLEX through the bindings to the C API #186
Workflow file for this run
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: Rust | |
on: | |
push: | |
branches: [main] | |
paths: ["**.rs", "Cargo.toml", ".github/workflows/rust.yml"] | |
pull_request: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
# 'lpsolve' and 'cplex-rs' features are incompatible | |
ALL_FEATURES_EXCEPT_CPLEX: "scip,singlethread-cbc,coin_cbc,highs,lp-solvers,minilp,russcip,lpsolve" | |
ALL_FEATURES_EXCEPT_LPSOLVE: "scip,singlethread-cbc,coin_cbc,highs,lp-solvers,minilp,russcip,cplex-rs" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo fmt -- --check | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: test | |
allow-softlinks: true | |
- name: install deps | |
run: | | |
sudo apt-get install coinor-cbc coinor-libcbc-dev libgsl-dev | |
# Install SCIP | |
conda install -y --prefix $CONDA/envs/test --channel conda-forge scip | |
echo "LD_LIBRARY_PATH=$CONDA/envs/test/lib" >> "${GITHUB_ENV}" | |
echo "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:$CONDA/envs/test/lib" >> "${GITHUB_ENV}" | |
echo "PATH=$CONDA/envs/test/bin:$PATH" >> "${GITHUB_ENV}" | |
echo "CONDA_PREFIX=$CONDA/envs/test" >> "${GITHUB_ENV}" | |
# install CPLEX | |
curl -LO https://github.com/rust-or/good_lp/releases/download/cplex/cplex.bin | |
chmod u+x cplex.bin | |
./cplex.bin -f ./.github/cplex/response.properties | |
- name: Build with all features except cplex-rs | |
run: cargo build --features ${{ env.ALL_FEATURES_EXCEPT_CPLEX }} --tests | |
- name: Run tests with all features except cplex-rs | |
# test on a single thread. See: https://github.com/KardinalAI/coin_cbc/issues/9 | |
run: cargo test --features ${{ env.ALL_FEATURES_EXCEPT_CPLEX }} -- --test-threads=1 | |
- name: Build with all features except lpsolve | |
run: cargo build --features ${{ env.ALL_FEATURES_EXCEPT_LPSOLVE }} --tests | |
- name: Run tests with all features except lpsolve | |
# test on a single thread. See: https://github.com/KardinalAI/coin_cbc/issues/9 | |
run: cargo test --features ${{ env.ALL_FEATURES_EXCEPT_LPSOLVE }} -- --test-threads=1 | |
- name: Run tests with minilp | |
run: cargo test --no-default-features --features minilp | |
- name: Run tests with lpsolve | |
run: cargo test --no-default-features --features lpsolve | |
- name: Run tests with highs | |
run: cargo test --no-default-features --features highs | |
- name: Run tests with lp_solvers | |
run: cargo test --no-default-features --features lp-solvers | |
- name: Run tests with SCIP | |
run: cargo test --no-default-features --features scip | |
- name: Run tests with CPLEX | |
run: cargo test --no-default-features --features cplex-rs | |
- run: cargo bench |