Skip to content

Feature/tests

Feature/tests #13

name: build-and-test-with-lammps-release-branch # workflow
# Triggers for the jobs in this workflow
on:
push:
branches: [ "master", "develop", "*/*" ]
pull_request:
branches: [ "master", "develop" ]
# Steps to build lammps with octp and run tests
jobs:
build-and-test:
runs-on: ubuntu-22.04 # GitHub hosted runner (machine) on which lammps will be built
steps:
- name: Checkout OCTP
uses: actions/checkout@v4
with:
path: octp
- name: Checkout LAMMPS release branch
uses: actions/checkout@v4
with:
repository: lammps/lammps
ref: release
path: lammps
- name: Copy OCTP files to LAMMPS src directory
run: |
cp --verbose octp/src/* lammps/src/
- name: Install OpenMPI in runner
run: |
sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
echo "mpi version"
mpicc --showme:version
- name: Build LAMMPS with OCTP plugin
run: |
cd lammps/src
make yes-asphere
make yes-body
make yes-class2
make yes-dipole
make yes-granular
make yes-kspace
make yes-manybody
make yes-molecule
make yes-rigid
make yes-shock
make -j 8 mpi
if ! [ -f lmp_mpi ]; then
echo "::error:: lammps binary does not exist"
exit 1
fi
- name: Run Tests
run: |
cd octp/tests/
mkdir build
cd build
cmake .. -DTEST_IN_GITHUB_ACTIONS=ON
make
./testoctp