-
Notifications
You must be signed in to change notification settings - Fork 16
95 lines (85 loc) · 2.92 KB
/
build-and-test-macos.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build and test (macOS)
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
jobs:
build-and-test:
runs-on: macos-12
strategy:
matrix:
compiler:
- { name: "g++-12", cxx: "g++-12" }
- { name: "clang", cxx: "clang++"}
install-libcommute: [true, false]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
brew update
brew install eigen open-mpi boost
- name: Install Doxygen
if: |
startsWith(matrix.compiler.name, 'clang') == true &&
matrix.install-libcommute
run: brew install doxygen graphviz
- name: Install libcommute
if: matrix.install-libcommute
env:
CXX: ${{ matrix.compiler.cxx }}
run: |
git clone https://github.com/krivenko/libcommute ${HOME}/libcommute
mkdir ${HOME}/libcommute.build && cd ${HOME}/libcommute.build
cmake ${HOME}/libcommute \
-DCMAKE_INSTALL_PREFIX=${HOME}/libcommute.ins \
-DTESTS=OFF \
-DEXAMPLES=OFF
make install
- name: Build
env:
CXX: ${{ matrix.compiler.cxx }}
run: |
if [[ "${{ matrix.compiler.name }}" == clang* ]]; then
DOCS=ON
else
DOCS=OFF
fi
if [[ "${{ matrix.install-libcommute }}" == true ]]; then
LCA="-Dlibcommute_DIR=${HOME}/libcommute.ins/lib/cmake/libcommute"
fi
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=installed \
${LCA} \
-DStaticAnalysis=OFF \
-DUSE_OPENMP=ON \
-DDocumentation=${DOCS} \
-DTesting=ON \
-DProgs=ON \
-Dprogs_list="anderson;hubbard2d" ..
make VERBOSE=1
- name: Build documentation
if: |
startsWith(matrix.compiler.name, 'clang') == true &&
matrix.install-libcommute
run: |
cd build
make doc
- name: Run unit tests
env:
TMPDIR: "/tmp"
run: |
mkdir -p $HOME/.prte
echo -e "\nrmaps_default_mapping_policy = :oversubscribe" >> \
$HOME/.prte/mca-params.conf
cd build
ctest --output-on-failure
- name: Install
run: |
cd build
make install