-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (49 loc) · 1.89 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
name: Build and test
on: [push, pull_request]
env:
CMAKE_COLOR_DIAGNOSTICS: ON
ASAN_OPTIONS: detect_stack_use_after_return=1:detect_leaks=1:color=always
UBSAN_OPTIONS: print_stacktrace=1:color=always
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 128M
IGRAPH_VERSION: 0.10.13
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Install igraph dependencies
run: sudo apt-get install ccache libglpk-dev libarpack2-dev
- name: Ccache
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
ccache-${{ github.ref_name }}-
ccache-
- name: Download and build igraph
run: |
cd ${{ github.workspace }}
wget https://github.com/igraph/igraph/releases/download/$IGRAPH_VERSION/igraph-$IGRAPH_VERSION.tar.gz
tar xfz igraph-$IGRAPH_VERSION.tar.gz
cd igraph-$IGRAPH_VERSION
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local -DBUILD_SHARED_LIBS=ON -DUSE_SANITIZER=Address -DCMAKE_BUILD_TYPE=Debug
cmake --build . --parallel
cmake --install .
- name: Checkout igraph-cpp
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create build environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure
working-directory: ${{github.workspace}}/build
run: |
cmake .. -DCMAKE_PREFIX_PATH=$HOME/local -DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=undefined -g -fno-omit-frame-pointer"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --parallel
- name: Test
run: ctest -j $(nproc) --output-on-failure --timeout 180
working-directory: ${{github.workspace}}/build