-
Notifications
You must be signed in to change notification settings - Fork 11
45 lines (43 loc) · 1.31 KB
/
build.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
name: C/C++ CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
compiler:
- { name: Clang, cc: clang, cxx: clang++ }
- { name: GNU, cc: gcc, cxx: g++ }
build-mode: [Debug, Release]
timeout-minutes: 60
steps:
- name: Install dependencies
run: sudo apt-get install -y libopenmpi3 libopenmpi-dev libsparsehash-dev
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: export-compiler
run: |
echo CXX=${{ matrix.compiler.cxx }} >> $GITHUB_ENV
echo CC=${{ matrix.compiler.cc }} >> $GITHUB_ENV
- name: cpu-cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: print-cpu-cores
run: echo ${{ steps.cpu-cores.outputs.count }}
- name: cmake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build-mode }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_C_COMPILER=${{ matrix.compiler.cc }} -DKAGEN_WARNINGS_ARE_ERRORS=ON -DKAGEN_BUILD_TESTS=ON
- name: build
run: cmake --build build/ --parallel ${{ steps.cpu-cores.outputs.count }}
- name: test
run: |
cd ./build
ctest --output-on-failure