Bump actions/checkout from 2 to 4 #6
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: CMake | |
on: | |
push: | |
branches: [ develop ] | |
pull_request: | |
branches: [ develop ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
# The CMake configure and build commands are platform agnostic and should work equally | |
# well on Windows or Mac. You can convert this to a matrix build if you need | |
# cross-platform coverage. | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
strategy: | |
matrix: | |
include: | |
- { os: ubuntu-20.04, CC: gcc, CXX: g++, python: '3.7' } | |
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8' } | |
- { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.9' } | |
- { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.10' } | |
- { os: ubuntu-latest, CC: clang, CXX: clang++, python: '3.11' } | |
- { os: ubuntu-latest, CC: gcc-12, CXX: g++-12, python: '3.11' } | |
- { os: macos-11, CC: clang, CXX: clang++, python: "3.10" } | |
- { os: macos-latest, CC: clang, CXX: clang++, python: "3.11" } | |
name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CC: ${{ matrix.CC }} | |
CXX: ${{ matrix.CXX }} | |
# SHELL: /bin/bash | |
#name: Ubuntu with Python ${{ matrix.python-version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Pip install | |
run: | | |
python3 -m pip install numpy | |
python3 -m pip install gemmi | |
python3 -m pip install spglib | |
#python3 -m pip install ase | |
#python3 -m pip install pymatgen | |
- name: Check versions | |
run: | | |
which python3 | |
python3 --version | |
which cmake | |
cmake --version | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: > | |
cmake | |
-S ${{github.workspace}}/src | |
-B ${{github.workspace}}/build | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install | |
-DNCRYSTAL_ENABLE_EXAMPLES=ON | |
-DNCRYSTAL_BUILD_STRICT=ON | |
- name: Build | |
run: > | |
cmake | |
--build ${{github.workspace}}/build | |
--config ${{env.BUILD_TYPE}} | |
- name: Install | |
run: cmake --install ${{github.workspace}}/build | |
- name: Look around | |
run: ls -l ${{github.workspace}} | |
- name: Tests without environment setup | |
run: | | |
${{github.workspace}}/install/bin/ncrystal-config --summary | |
${{github.workspace}}/install/bin/nctool --test | |
${{github.workspace}}/install/bin/ncrystal_example_c | |
${{github.workspace}}/install/bin/ncrystal_example_cpp | |
${{github.workspace}}/install/bin/nctool --dump 'Al_sg225.ncmat;dcutoff=1.5' | |
- name: Tests with eval ncrystal-config setup | |
run: | | |
eval $(${{github.workspace}}/install/bin/ncrystal-config --setup) | |
ncrystal-config --summary | |
nctool --test | |
ncrystal-config --help | |
ncrystal_example_c | |
ncrystal_example_cpp | |
ncrystal_example_py | |
nctool --help | |
nctool --dump 'Al_sg225.ncmat;dcutoff=1.5' | |
python3 -c 'import NCrystal; NCrystal.test()' | |
ncrystal_vdos2ncmat --help | |
ncrystal_cif2ncmat --help | |
ncrystal_ncmat2cpp --help | |
ncrystal_hfg2ncmat --help | |
ncrystal_verifyatompos --help | |
ncrystal_cif2ncmat codid::9008460 | |
ncrystal_ncmat2hkl --help | |
ncrystal_ncmat2hkl --format=laz 'Al_sg225.ncmat;temp=250K;dcutoff=0.75' -o test_Al.laz | |
ncrystal_ncmat2hkl --format=lau 'Al_sg225.ncmat;temp=250K;dcutoff=0.75' -o test_Al.lau | |
nctool -d ./test_Al.laz | |
nctool -d ./test_Al.lau | |
ncrystal_ncmat2cpp $(ncrystal-config --show=datadir)/Al_sg225.ncmat -o test.cpp | |
cat test.cpp | |
eval $(ncrystal-config --unsetup) | |
#NEEDS MATPLOTLIB: nctool --pdf Al_sg225.ncmat | |
- name: Tests with setup.sh | |
run: | | |
. ${{github.workspace}}/install/setup.sh | |
ncrystal-config --summary | |
nctool --test | |
ncrystal_inspectfile --test | |
ncrystal_vdos2ncmat --help | |
ncrystal_cif2ncmat --help | |
ncrystal_ncmat2hkl --help | |
ncrystal_ncmat2hkl --format=laz 'Al_sg225.ncmat;temp=250K;dcutoff=0.75' -o test2_Al.laz | |
ncrystal_ncmat2hkl --format=lau 'Al_sg225.ncmat;temp=250K;dcutoff=0.75' -o test2_Al.lau | |
nctool -d ./test2_Al.laz | |
nctool -d ./test2_Al.lau | |
ncrystal_ncmat2cpp --help | |
ncrystal_hfg2ncmat --help | |
ncrystal_verifyatompos --help | |
ncrystal_example_c | |
ncrystal_example_cpp | |
ncrystal_example_py | |
python3 -m NCrystal.test | |
python3 -c 'import NCrystal; NCrystal.test()' | |
. ${{github.workspace}}/install/unsetup.sh | |