-
Notifications
You must be signed in to change notification settings - Fork 62
56 lines (50 loc) · 2.1 KB
/
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
name: CMake test matrix
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build:
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- { name: GNU, CC: gcc-10, CXX: g++-10 }
- { name: LLVM, CC: clang, CXX: clang++ }
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: install mpich and gcc
run: |
sudo apt update
sudo apt install gcc-10 g++-10 mpich
- name: Configure CMake
env:
MPICH_CXX: ${{matrix.compiler.CXX}}
MPICH_CC: ${{matrix.compiler.CC}}
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_VERBOSE_MAKEFILE=ON -DMESHES=${{github.workspace}}/pumi-meshes -DIS_TESTING=ON -DSCOREC_CXX_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install
- name: Build
env:
MPICH_CXX: ${{matrix.compiler.CXX}}
MPICH_CC: ${{matrix.compiler.CC}}
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j --target install
- name: Test
env:
MPICH_CXX: ${{matrix.compiler.CXX}}
MPICH_CC: ${{matrix.compiler.CC}}
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -C ${{matrix.build_type}}
- name: Build User Project
# only need to test with a single build config if the installed cmake config files work
if: matrix.compiler.name == 'GNU' && matrix.build_type == 'Release'
env:
MPICH_CXX: ${{matrix.compiler.CXX}}
MPICH_CC: ${{matrix.compiler.CC}}
run: |
cmake -S ${{github.workspace}}/doc -B ${{github.workspace}}/buildExample -DCMAKE_CXX_COMPILER=mpicxx -DSCOREC_PREFIX=${{github.workspace}}/build/install
cmake --build ${{github.workspace}}/buildExample