-
Notifications
You must be signed in to change notification settings - Fork 84
107 lines (91 loc) · 2.85 KB
/
n2p2-ci.yaml
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
name: n2p2-ci
on:
push:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install required system packages
run: |
# Docs
# API docs with doxygen (built via makefile, needs cmake),
# generating graphs with doxygen requires dot.
sudo apt install cmake graphviz
# Build
# MPI
sudo apt install openmpi-bin libopenmpi-dev
# BLAS
sudo apt install libblas3 libblas-dev
# Eigen library
sudo apt install libeigen3-dev
# GSL library
sudo apt install libgsl-dev
# Tests
# Boost Test for C++ testing
sudo apt install libboost-test-dev libboost-filesystem-dev
# Coverage for C++
sudo apt install lcov
- name: Install required Python packages
run: |
# Docs
pip install sphinx
pip install sphinx_rtd_theme
pip install breathe
# pynnp
pip install cython==3.0.11
# python tests
pip install pytest #==7.1.3
pip install pytest-cov #==4.0.0
pip install coverage #==7.6.1
- name: Build n2p2 libraries and applications
run: make MODE=test -j4
working-directory: ./src
- name: Build documentation
run: |
# Pre-build doxygen only on 4 cores (-j hangs on Github Actions).
cd doc/doxygen/
make CORES=4 doxygen
cd ../..
# Now build the rest of the documentation.
make doc
# Prevent GitHub Jekyll to interfere with Sphinx theme.
touch ../doc/sphinx/html/.nojekyll
working-directory: ./src
- name: Build LAMMPS with n2p2 support
run: make MODE=test lammps-hdnnp
working-directory: ./src
- name: Run C++ tests and coverage
run: |
make cpp
cd cpp
make coverage
rm *.gcda *.gcno
working-directory: ./test
- name: Build pynnp
run: make pynnp MODE=test
working-directory: ./src
- name: Run python tests
run: make python
working-directory: ./test
- name: Upload C++ coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: test/cpp/tests.info
flags: cpp
verbose: true
- name: Upload Python coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: test/python
flags: python
verbose: true
- name: Deploy Github pages
if: ${{ github.ref == 'refs/heads/master' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: doc/sphinx/html