Skip to content

set up ci

set up ci #2

Workflow file for this run

name: Build and test
on: [push, pull_request]
env:
CMAKE_GENERATOR: Ninja
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 128M
ASAN_OPTIONS: detect_stack_use_after_return=1:color=always
UBSAN_OPTIONS: print_stacktrace=1:color=always
OMP_NUM_THREADS: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get install lcov libglpk-dev libarpack2-dev libigraph-dev
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create build environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configuration
run: |
cmake .. -DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=undefined -g -fno-omit-frame-pointer"
- name: Ccache
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-msys2-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
ccache-${{ github.ref_name }}-
ccache-
- 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
- name: Ccache stats
run: ccache -sv