Feature/tests #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-and-test-with-lammps-stable-release # workflow | |
# Triggers for the jobs in this workflow | |
on: | |
push: | |
branches: [ "master", "develop", "*/*" ] | |
pull_request: | |
branches: [ "master", "develop" ] | |
# Variables | |
env: | |
# tag or commit ID of the lammps release with which we want to build and test | |
LAMMPS_RELEASE: 'stable_2Aug2023_update1' | |
# 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 latest stable_* tagged release | |
uses: actions/checkout@v4 | |
with: | |
repository: lammps/lammps | |
ref: ${{ env.LAMMPS_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 |