Redesign Build System for PyNE with Scikit-Build #21
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: Quick Wheel test | |
on: | |
# allows running workflows manually | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- develop | |
paths-ignore: | |
- docs/** | |
push: | |
branches: | |
- develop | |
paths-ignore: | |
- docs/** | |
jobs: | |
main: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install hdf5 Ubuntu | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gfortran libblas-dev liblapack-dev libeigen3-dev libhdf5-dev hdf5-tools | |
# hdf5 std directory | |
hdf5_libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial | |
# need to put libhdf5.so on LD_LIBRARY_PATH | |
if [ -z $LD_LIBRARY_PATH ]; then | |
export LD_LIBRARY_PATH="${hdf5_libdir}:$GITHUB_WORKSPACE/lib" | |
else | |
export LD_LIBRARY_PATH="${hdf5_libdir}:$GITHUB_WORKSPACE/lib:$LD_LIBRARY_PATH" | |
fi | |
if: matrix.os == 'ubuntu-latest' | |
- name: Install Miniconda Windows | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-activate-base: true | |
activate-environment: "" | |
if: matrix.os == 'windows-latest' | |
- name: Install hdf5 Windows | |
run: | | |
conda install curl eigen | |
conda install -c conda-forge hdf5 | |
conda remove -y yaml-cpp | |
echo "HOME_PATH=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV | |
echo "CONDA_LOC=C:/Miniconda/Library" >> $GITHUB_ENV | |
$hdf5_libdir="C:/Miniconda/Library" | |
if: matrix.os == 'windows-latest' | |
- name: Install hdf5 MacOS | |
run: | | |
brew install hdf5 eigen | |
echo "HOME=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV | |
hdf5_libdir=$HDF5_PATH | |
if: matrix.os == 'macos-latest' | |
- name: Install MOAB | |
run: | | |
cd $GITHUB_WORKSPACE | |
python -m pip install "cython<3" numpy | |
# clone and version | |
git clone --depth 1 https://bitbucket.org/fathomteam/moab -b 5.3.0 moab-repo | |
cd moab-repo | |
mkdir -p build | |
cd build | |
# cmake, build and install | |
cmake ../ -DENABLE_HDF5=ON \ | |
-DHDF5_ROOT=$hdf5_libdir \ | |
-DBUILD_SHARED_LIBS=ON \ | |
-DENABLE_PYMOAB=ON \ | |
-DENABLE_BLASLAPACK=OFF \ | |
-DENABLE_FORTRAN=OFF \ | |
-DCMAKE_INSTALL_PREFIX=$(which python) | |
make | |
make install | |
cd $GITHUB_WORKSPACE | |
# Remove the temporary directory | |
rm -rf $GITHUB_WORKSPACE/moab-repo | |
echo "MOAB installed" | |
- name: Install DAGMC | |
run: | | |
cd $GITHUB_WORKSPACE | |
# make a new temporary directory | |
# clone the repository | |
git clone https://github.com/ahnaf-tahmid-chowdhury/DAGMC.git dagmc-repo | |
cd dagmc-repo | |
mkdir -p build | |
cd build | |
# cmake, build and install | |
cmake ../ -DMOAB_CMAKE_CONFIG=$(which python)/lib/cmake/MOAB \ | |
-DMOAB_DIR=$(which python) \ | |
-DBUILD_STATIC_LIBS=OFF \ | |
-DBUILD_TALLY=ON \ | |
-DCMAKE_INSTALL_PREFIX=$(which python) | |
make | |
make install | |
cd $GITHUB_WORKSPACE | |
# Remove the temporary directory | |
rm -rf "$GITHUB_WORKSPACE/dagmc-repo" | |
echo "DAGMC installed" | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build wheels | |
run: | | |
export MOAB_ROOT=$(which python) | |
export DAGMC_ROOT=$(which python) | |
python setup.py bdist_wheel | |
- name: Install PyNE | |
run: | | |
python -m pip install dist/pyne*.whl | |
- name: Install pytest | |
run: | | |
python -m pip install pytest | |
- name: Test PyNE | |
run: python -m pytest -ra tests |