-
Notifications
You must be signed in to change notification settings - Fork 36
60 lines (57 loc) · 2.34 KB
/
rust.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
name: Rust
on:
push:
branches: [main]
paths: ["**.rs", "Cargo.toml", ".github/workflows/rust.yml"]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
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 default solvers (no cplex)
run: cargo build --features all_default_solvers --tests
- name: Run tests with all default solvers (no cplex)
# test on a single thread. See: https://github.com/KardinalAI/coin_cbc/issues/9
run: cargo test --features all_default_solvers -- --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
- name: Run tests with Clarabel
run: cargo test --no-default-features --features clarabel
- run: cargo bench