diff --git a/.github/workflows/kokkos-regression.yaml b/.github/workflows/kokkos-regression.yaml new file mode 100644 index 0000000000..661c646c2f --- /dev/null +++ b/.github/workflows/kokkos-regression.yaml @@ -0,0 +1,90 @@ +# GitHub action to build LAMMPS on Linux and run selected regression tests +name: "Kokkos Regression Test" + +on: + pull_request: + branches: + - develop + + workflow_dispatch: + +jobs: + build: + name: Build LAMMPS + # restrict to official LAMMPS repository + if: ${{ github.repository == 'lammps/lammps' }} + runs-on: ubuntu-latest + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + show-progress: false + + - name: Install extra packages + run: | + sudo apt-get update + sudo apt-get install -y ccache ninja-build libeigen3-dev \ + libcurl4-openssl-dev python3-dev \ + mpi-default-bin mpi-default-dev + + - name: Create Build Environment + run: mkdir build + + - name: Set up ccache + uses: actions/cache@v4 + with: + path: ${{ env.CCACHE_DIR }} + key: linux-quick-ccache-${{ github.sha }} + restore-keys: linux-quick-ccache- + + - name: Building LAMMPS via CMake + shell: bash + run: | + ccache -z + python3 -m venv linuxenv + source linuxenv/bin/activate + python3 -m pip install --upgrade pip + python3 -m pip install numpy pyyaml junit_xml + cmake -S cmake -B build \ + -C cmake/presets/gcc.cmake \ + -C cmake/presets/basic.cmake \ + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -D CMAKE_C_COMPILER_LAUNCHER=ccache \ + -D BUILD_SHARED_LIBS=off \ + -D DOWNLOAD_POTENTIALS=off \ + -D PKG_KOKKOS=on \ + -D Kokkos_ARCH_ARMAVX=on \ + -D Kokkos_ENABLE_OPENMP=on \ + -D Kokkos_ENABLE_CUDA=off \ + -D PKG_COLLOID=on \ + -D PKG_GRANULAR=on \ + -D PKG_ML-SNAP=on \ + -D BUILD_OMP=yes \ + -G Ninja + cmake --build build + ccache -s + + - name: Run Regression Tests for Selected Examples + shell: bash + run: | + source linuxenv/bin/activate + python3 tools/regression-tests/run_tests.py \ + --lmp-bin=build/lmp \ + --config-file=tools/regression-tests/config_kokkos.yaml \ + --example-folders="examples/colloid;examples/melt;examples/micelle;examples/threebody;examples/snap;" + --output-file=output.xml \ + --progress-file=progress.yaml \ + --log-file=run.log + + tar -cvf kokkos-regression-test.tar run.log progress.yaml output.xml + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: kokkos-regression-test-artifact + path: kokkos-regression-test.tar +