forked from FitSNAP/FitSNAP
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (77 loc) · 2.47 KB
/
Copy pathpytests.yaml
File metadata and controls
81 lines (77 loc) · 2.47 KB
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
name: FitSNAP Pytests
on:
push:
branches: [master]
jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
test: [mpi, quad, eme, xyz, neme, spin, pace]
max-parallel: 20
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Load Mac Env
if: matrix.os == 'macos-latest'
run: |
brew install openmpi
brew install cmake
- name: Load Ubuntu Env
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install mpi-default-bin mpi-default-dev ninja-build
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
which python
conda install numpy
conda install pandas
conda install tabulate
conda install scipy
conda install psutil
- name: Lint with flake8
run: |
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install LAMMPS
shell: bash
run: |
which python
# conda activate base
cd ../
git clone https://github.com/lammps/lammps.git
cd lammps/cmake
mkdir build
cd build
cmake -D PKG_ML-SNAP=yes -D PKG_SPIN=yes -D LAMMPS_EXCEPTIONS=yes -D BUILD_SHARED_LIBS=yes -D Python_FIND_FRAMEWORK=LAST ../
make -j 20
make install-python
cd ../../../FitSNAP
- name: Test stubs with pytest
run: |
conda install pytest
export PYTHONPATH=$(pwd):$PYTHONPATH
cd tests
pytest test_examples.py::test_stubs
- name: Get mpi4py
run: |
cd $CONDA/lib/python*/site-packages/
ls
curl -L https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.1.3.tar.gz -o mpi4py-3.1.3.tar.gz
tar -xzvf mpi4py-3.1.3.tar.gz
cd mpi4py-3.1.3
python setup.py build
python setup.py install
- name: Test rest of tests
run: |
export PYTHONPATH=$(pwd):$PYTHONPATH
cd tests
pytest -s test_examples.py::test_fitsnap_${{ matrix.test}}