-
Notifications
You must be signed in to change notification settings - Fork 296
270 lines (262 loc) · 8.73 KB
/
ci.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
name: CI
on:
push:
pull_request:
env:
# on CI, better dump stack trace in case there is an error
PLUMED_STACK_TRACE: yes
# use two threads for openMP tests
PLUMED_NUM_THREADS: 2
# these are used to build required packages
CC: gcc
CXX: g++
jobs:
linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
variant:
- -doc-mpi-
- -coverage-mpi-
- -debug-
- -debug-mpi-
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-linux${{ matrix.variant }}hash-${{ github.sha }}
restore-keys: ccache-linux${{ matrix.variant }}hash-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Set paths
run: |
echo "$HOME/opt/bin" >> $GITHUB_PATH
# path required for nosetest:
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "CPATH=$HOME/opt/include:$CPATH" >> $GITHUB_ENV
echo "INCLUDE=$HOME/opt/include:$INCLUDE" >> $GITHUB_ENV
echo "LIBRARY_PATH=$HOME/opt/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PYTHONPATH=$HOME/opt/lib/plumed/python:$PYTHONPATH" >> $GITHUB_ENV
- name: Install generic packages
run: |
sudo apt-get update -qq
sudo apt-get install -y libatlas-base-dev
sudo apt-get install -y libfftw3-dev
sudo apt-get install -y gsl-bin
sudo apt-get install -y libgsl0-dev
sudo apt-get install -y ccache
./.travis/install.xdrfile
- name: Install system boost
if: ${{ ! contains( matrix.variant, '-debug-' ) }}
run: |
sudo apt-get install -y libboost-serialization-dev
- name: Install boost with debug flags
if: contains( matrix.variant, '-debug-' )
run: |
.travis/install.boost
- name: Install python packages needed for tests
run: |
python -m pip install --upgrade pip
pip install --user Cython
pip install --user numpy
pip install --user nose
pip install --user six ;
pip install --user pandas ;
pip install --user mdtraj ;
pip install --user MDAnalysis ;
python -c "import MDAnalysis" ;
python -c "import mdtraj" ;
- name: Install Doxygen
if: contains( matrix.variant, '-doc-' )
run: |
sudo apt-get install -y graphviz
sudo apt-get install -y doxygen-latex
./.travis/install.doxygen Release_1_8_17
echo "PLUMED_CONFIG=$PLUMED_CONFIG --enable-pdfdoc --enable-asmjit" >> $GITHUB_ENV
# make sure all tests are run
echo "PLUMED_ALL_TESTS=yes" >> $GITHUB_ENV
- name: Install lcov
if: contains( matrix.variant, '-coverage-' )
run: |
./.travis/install.lcov v1.15
echo "PLUMED_CONFIG=$PLUMED_CONFIG --disable-external-lapack --disable-external-blas --enable-gcov CXXFLAGS=-O" >> $GITHUB_ENV
# make sure all tests are run
echo "PLUMED_ALL_TESTS=yes" >> $GITHUB_ENV
- name: Setup debug flags
if: contains( matrix.variant, '-debug-' )
run: |
echo "PLUMED_CONFIG=$PLUMED_CONFIG --enable-debug --enable-debug-glibcxx" >> $GITHUB_ENV
- name: Install MPI
# install MPI at last since it modifies CC and CXX
if: contains( matrix.variant, '-mpi-' )
run: |
sudo apt-get install -y libopenmpi-dev openmpi-bin
echo "CC=mpicc" >> $GITHUB_ENV
echo "CXX=mpic++" >> $GITHUB_ENV
echo "OMPI_MCA_btl_base_warn_component_unused=0" >> $GITHUB_ENV
echo "OMPI_MCA_btl_base_verbose=0" >> $GITHUB_ENV
echo "MPIEXEC=mpirun --oversubscribe" >> $GITHUB_ENV
- name: Build PLUMED
run: |
ccache -s -M 100M
./configure CXX="ccache $CXX" --enable-boost_serialization --disable-dependency-tracking --enable-modules=all LDFLAGS=-Wl,-rpath,$LD_LIBRARY_PATH $PLUMED_CONFIG --prefix="$HOME/opt"
make -j 4
make install
ccache -s -M 100M
- name: Run tests
run: |
(while true; do # see https://github.com/actions/virtual-environments/issues/1860
df -h
sleep 15
done) &
make --no-print-directory -C regtest testclean
# these can fail for numerical reasons
make -C regtest checkfail
- name: Run python tests
run: |
nosetests -v -w python
- name: Build doc
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN_PLUMEDBOT }}
if: contains( matrix.variant, '-doc-' )
run: |
make doc >/dev/null
- name: Coverage
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN_PLUMEDBOT }}
if: contains( matrix.variant, '-coverage-' )
run: |
make -C developer-doc coverage
./.travis/push coverage
bash <(curl -s https://codecov.io/bash) > /dev/null
- name: Push doc
if: contains( matrix.variant, '-doc-' )
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN_PLUMEDBOT }}
run: |
./.travis/push doc
codecheck:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set path
run: |
echo "$HOME/opt/bin" >> $GITHUB_PATH
- name: Install requirements
run: |
./.travis/install.cppcheck 1.90
- name: Build astyle
run: |
make -j 4 -C astyle
- name: Checking code
run: |
# this is required so as to have all the include files in place
# notice that this is done automatically in build
make -C src/lib/ dirslinks
make codecheck
centos7:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build and run tests
run: |
make -C docker centos7
macports:
runs-on: macos-11
strategy:
fail-fast: false
matrix:
variant: [ "" , "+allmodules" ]
# see https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 for possible exclusions
env:
PYVERS: "py37 py38"
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.macports-ci-ccache
key: ccache-macports-${{ matrix.variant }}-${{ github.sha }}
restore-keys: ccache-macports-${{ matrix.variant }}-
- name: Install MacPorts
run: |
wget https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
source ./macports-ci install
source ./macports-ci ccache
- name: Build local Portfile
run: |
make macports
source ./macports-ci localports macports
- name: Build PLUMED
run: |
sudo port -N -k install plumed ${{ matrix.variant }}
plumed config show
for p in $PYVERS ; do
sudo port -N install $p-plumed
done
source ./macports-ci ccache --save
- name: Run tests
run: |
sudo port -N -d test plumed ${{ matrix.variant }}
# NOT WORKING FOR SOME MACPORTS RELATED REASON - GB 28/01/2022
#for p in $PYVERS ; do
# sudo port test $p-plumed
#done
macsimple:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- name: Set paths
run: |
echo "$HOME/opt/bin" >> $GITHUB_PATH
echo "CPATH=$HOME/opt/include:$CPATH" >> $GITHUB_ENV
echo "INCLUDE=$HOME/opt/include:$INCLUDE" >> $GITHUB_ENV
echo "LIBRARY_PATH=$HOME/opt/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Build PLUMED
run: |
brew update > /dev/null
brew install gawk
./configure --disable-dependency-tracking --prefix="$HOME/opt"
make -j 4
make install
- name: Run tests
run: |
make --no-print-directory -C regtest
# these can fail for numerical reasons
make -C regtest checkfail
conda:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04 , macos-11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install conda
run: |
curl -LO https://raw.githubusercontent.com/GiovanniBussi/conda-ci/master/conda-ci
source ./conda-ci install
source ./conda-ci install-conda-build
- name: Build PLUMED
run: |
source activate base
export VERSION=none
if [[ $GITHUB_REF == "refs/tags/"* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION//-/_}
VERSION=${VERSION#v}
fi
make -C conda
- name: Deploy
env:
CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }}
if: ${{ startsWith( github.ref , 'refs/tags/' ) }}
run: |
source activate base
export CONDA_LABEL=tag
make -C conda upload