-
Notifications
You must be signed in to change notification settings - Fork 98
64 lines (54 loc) · 1.96 KB
/
build_cmake.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
61
62
63
64
name: AI-Toolbox
on:
push:
branches:
- master
- test
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Do not stop all jobs if a single job fails.
fail-fast: false
matrix:
os: [ubuntu-20.04]
build-type: ["Release"]
cxx: ["g++"] #, "clang++"]
gcc: [10]
clang: [12]
python-version: ["2.7", "3.8"]
steps:
- name: Checkout repository.
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies.
run: |
sudo apt install libboost-all-dev liblpsolve55-dev lp-solve python3-future
- name: Install Eigen 3.4
run: |
git clone --single-branch --depth=1 --branch 3.4.0 https://gitlab.com/libeigen/eigen.git
mkdir eigen/build
cd eigen/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$HOME/.local/eigen"
make -j2 install
- name: Create build folder
run: |
mkdir ${{ runner.workspace }}/AI-Toolbox/build
- name: Run CMake
working-directory: ${{ runner.workspace }}/AI-Toolbox/build
run: |
if [ "${{ matrix.cxx }}" = "g++" ]; then export CXX="/usr/bin/g++-10" CC="/usr/bin/gcc-10"; fi
if [ "${{ matrix.cxx }}" = "clang++" ]; then export CXX="/usr/bin/clang++-12" CC="/usr/bin/clang-12"; fi
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DEIGEN3_INCLUDE_DIR="$HOME/.local/eigen/include/eigen3" -DMAKE_PYTHON=1 -DAI_PYTHON_VERSION=${{ matrix.python-version }} -DAI_LOGGING_ENABLED=1
- name: Build
working-directory: ${{ runner.workspace }}/AI-Toolbox/build
run: |
make -j2 VERBOSE=1
- name: Run tests
working-directory: ${{ runner.workspace }}/AI-Toolbox/build
run: |
ctest -V -j2 --output-on-failure --repeat until-pass:3