70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
# GitHub action to test LAMMPS on Windows with Visual C++
|
|
name: "Windows Unit Tests"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
pull_request:
|
|
branches:
|
|
- develop
|
|
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
|
|
|
jobs:
|
|
build:
|
|
name: Windows Compilation Test
|
|
if: ${{ github.repository == 'lammps/lammps' }}
|
|
runs-on: windows-latest
|
|
env:
|
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Enable MSVC++
|
|
uses: lammps/setup-msvc-dev@v3
|
|
with:
|
|
arch: x64
|
|
|
|
- name: Install Ccache
|
|
run: |
|
|
choco install ccache ninja -y
|
|
|
|
- name: Set up ccache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.CCACHE_DIR }}
|
|
key: win-unit-ccache-${{ github.sha }}
|
|
restore-keys: win-unit-ccache-
|
|
|
|
- name: Select Python version
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Building LAMMPS via CMake
|
|
run: |
|
|
ccache -z
|
|
python3 -m pip install numpy
|
|
python3 -m pip install pyyaml
|
|
cmake -C cmake\presets\windows.cmake -D CMAKE_CXX_COMPILER=cl -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -D CMAKE_C_COMPILER=cl -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_Fortran_COMPILER="" -D DOWNLOAD_POTENTIALS=off -D PKG_PYTHON=on -D WITH_PNG=off -D WITH_JPEG=off -S cmake -B build -D BUILD_SHARED_LIBS=on -D ENABLE_TESTING=on -D CMAKE_BUILD_TYPE=Release -G Ninja
|
|
cmake --build build
|
|
ccache -s
|
|
|
|
- name: Run LAMMPS executable
|
|
run: |
|
|
build\lmp.exe -h
|
|
build\lmp.exe -in bench\in.lj
|
|
|
|
- name: Run Unit Tests
|
|
working-directory: build
|
|
run: ctest -V -E FixTimestep:python_move_nve
|