-
Notifications
You must be signed in to change notification settings - Fork 16
112 lines (100 loc) · 3.65 KB
/
build-and-test-ubuntu.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build and test (Ubuntu)
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
jobs:
build-and-test:
runs-on: ubuntu-20.04
strategy:
matrix:
compiler:
- { name: "g++-9", cxx: "g++-9" }
- { name: "clang-10", cxx: "clang++-10" }
install-libcommute: [true, false]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y libeigen3-dev libopenmpi-dev libboost-all-dev
sudo apt-get install -y ${{ matrix.compiler.name }}
- name: Install Doxygen
if: |
startsWith(matrix.compiler.name, 'clang') == true &&
matrix.install-libcommute
run: sudo apt-get install -y 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* &&
"${{ matrix.install-libcommute }}" == true ]]; 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_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
run: |
sudo sh -c 'echo -e "\nrmaps_base_oversubscribe = 1" >> \
/etc/openmpi/openmpi-mca-params.conf'
cd build
ctest --output-on-failure
- name: Install
run: |
cd build
make install
- name: Copy GitHub Pages Jekyll configuration file
if: |
startsWith(matrix.compiler.name, 'clang') == true &&
matrix.install-libcommute
run: |
cp scripts/gh_pages_config.yml \
build/installed/share/doc/pomerol/_config.yml
- name: Deploy documentation
if: |
github.ref == 'refs/heads/master' &&
startsWith(matrix.compiler.name, 'clang') == true &&
matrix.install-libcommute
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/installed/share/doc/pomerol