Skip to content

clean up example

clean up example #562

Workflow file for this run

name: Tests
on:
push:
branches: [ "*", "!gh-pages" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
modeling:
name: "Modeling"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Eigen
run: wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2
- name: Install Eigen
run: tar -xvf eigen*.tar.bz2 && rm eigen*.tar.bz2 && find . -depth -type d -name eigen-* -execdir mv {} ${{github.workspace}}/Eigen \;
- name: Install lcov
run: sudo apt-get install lcov
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DBUILD_TESTS=YES -DWITH_TEST_COVERAGE=YES -DUSE_EIGEN=YES -DEIGEN_DIR=${{github.workspace}}/Eigen
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build/tests
run: (cd ./mixed-integer/modeling && ./test_modeling_interface)
- name: Build coverage report
run: lcov --directory . --capture --output-file coverage__$(uuidgen).info
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage__*.info
Mosek:
name: "Mosek"
runs-on: ubuntu-latest
strategy:
matrix:
test:
- "(cd mixed-integer/branch-and-bound/ && ./test_bab_knapsack_Mosek)"
- "(cd mixed-integer/branch-and-bound/ && ./test_bab_location_Mosek)"
- "(cd mixed-integer/branch-and-price/ && ./test_bap_assignment_Mosek)"
- "(cd mixed-integer/dualizer/ && ./test_dualizer_location_Mosek)"
steps:
- uses: actions/checkout@v4
- name: Download Eigen
run: wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2
- name: Install Eigen
run: tar -xvf eigen*.tar.bz2 && rm eigen*.tar.bz2 && find . -depth -type d -name eigen-* -execdir mv {} ${{github.workspace}}/Eigen \;
- name: Download Mosek
run: wget https://download.mosek.com/stable/10.0.47/mosektoolslinux64x86.tar.bz2
- name: Install Mosek
run: tar -xvf mosektoolslinux64x86.tar.bz2 -C ${{github.workspace}} && (cd ${{github.workspace}}/mosek/10.0/tools/platform/linux64x86/src/fusion_cxx && make install)
- name: Install Mosek license
run: 'echo "${MOSEK_LICENSE}" | base64 --decode > ${{github.workspace}}/mosek/mosek.lic'
env:
MOSEK_LICENSE: ${{secrets.MOSEK_LICENSE}}
- name: Install lcov
run: sudo apt-get install lcov
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DBUILD_TESTS=YES -DWITH_TEST_COVERAGE=YES -DUSE_EIGEN=YES -DEIGEN_DIR=${{github.workspace}}/Eigen -DUSE_MOSEK=YES -DUSE_EIGEN=YES -DMOSEK_DIR=${{github.workspace}}/mosek/10.0/tools/platform/linux64x86
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build/tests
run: ${{ matrix.test }}
env:
MOSEKLM_LICENSE_FILE: ${{github.workspace}}/mosek/mosek.lic
- name: Build coverage report
run: lcov --directory . --capture --output-file coverage__$(uuidgen).info
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage_*.info
GLPK:
name: "GLPK"
runs-on: ubuntu-latest
strategy:
matrix:
test:
- "(cd mixed-integer/branch-and-bound/ && ./test_bab_knapsack_GLPK)"
- "(cd mixed-integer/branch-and-bound/ && ./test_bab_location_GLPK)"
- "(cd mixed-integer/branch-and-price/ && ./test_bap_assignment_GLPK)"
- "(cd mixed-integer/dualizer/ && ./test_dualizer_location_GLPK)"
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: sudo apt-get install lcov
- name: Update apt-get
run: sudo apt-get update
- name: Install GLPK
run: sudo apt-get install glpk-utils libglpk-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DBUILD_TESTS=YES -DWITH_TEST_COVERAGE=YES -DUSE_GLPK=YES
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build/tests
run: ${{ matrix.test }}
- name: Build coverage report
run: lcov --directory . --capture --output-file coverage__$(uuidgen).info
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage_*.info
HiGHS:
name: "HiGHS"
runs-on: ubuntu-latest
strategy:
matrix:
test:
- "(cd mixed-integer/branch-and-bound/ && ./test_bab_knapsack_HiGHS)"
- "(cd mixed-integer/branch-and-bound/ && ./test_bab_location_HiGHS)"
- "(cd mixed-integer/branch-and-price/ && ./test_bap_assignment_HiGHS)"
- "(cd mixed-integer/dualizer/ && ./test_dualizer_location_HiGHS)"
steps:
- uses: actions/checkout@v3
- name: Install lcov
run: sudo apt-get install lcov
- name: Download HiGHS
run: git clone --depth 1 --branch v1.7.1 https://github.com/ERGO-Code/HiGHS.git
- name: Install HiGHS
run: mkdir HiGHS/build && cd HiGHS/build && cmake .. && make && sudo make install
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DBUILD_TESTS=YES -DWITH_TEST_COVERAGE=YES -DUSE_HIGHS=YES
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build/tests
run: ${{ matrix.test }}
- name: Build coverage report
run: lcov --directory . --capture --output-file coverage__$(uuidgen).info
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage_*.info
Coverage:
name: "Coverage Report"
runs-on: ubuntu-latest
needs: [GLPK, Mosek, HiGHS, modeling]
steps:
- uses: actions/checkout@v3
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: coverage
- name: Install lcov
run: sudo apt-get install lcov
- name: Merge all reports
run: ./scripts/merge_coverage.sh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage.info
flags: default