Test Hammer install #163
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: Tests | |
on: [push] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
#container: python:3.10 # optional | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake build-essential # Install cmake and build tools | |
sudo apt-get install libboost-all-dev | |
- name: Extract Hammer source | |
run: | | |
git clone https://gitlab.com/mpapucci/Hammer.git | |
cd Hammer | |
git checkout v1.3.0 | |
sed -i '62s|set(Hammer_CompileOptions "${Hammer_CompileOptions} -ansi -D_FILE_OFFSET_BITS=64 -Wno-unknown-pragmas")|set(Hammer_CompileOptions "${Hammer_CompileOptions} -D_FILE_OFFSET_BITS=64 -Wno-unknown-pragmas")|' CMakeModules/CompilerChecks.cmake | |
sed -i '212s|UNDEFINED = b\'u\'|UNDEFINED = 117|' pyext/wrapper/cppdefs.pxd | |
sed -i '213s|HEADER = b\'b\'|HEADER = 98|' pyext/wrapper/cppdefs.pxd | |
sed -i '214s|EVENT = b\'e\'|EVENT = 101|' pyext/wrapper/cppdefs.pxd | |
sed -i '215s|HISTOGRAM = b\'h\'|HISTOGRAM = 104|' pyext/wrapper/cppdefs.pxd | |
sed -i '216s|RATE = b\'n\'|RATE = 114|' pyext/wrapper/cppdefs.pxd | |
sed -i '217s|HISTOGRAM_DEFINITION = b\'d\'|HISTOGRAM_DEFINITION = 100|' pyext/wrapper/cppdefs.pxd | |
cd .. | |
- name: Build Hammer | |
run: | | |
mkdir Hammer-build | |
cd Hammer-build | |
cmake -DCMAKE_INSTALL_PREFIX=../Hammer-install -DINSTALL_EXTERNAL_DEPENDENCIES=ON -DFORCE_YAMLCPP_INSTALL=ON ../Hammer | |
make | |
make install | |
cd pyext | |
pip install . | |
cd ../.. | |
- name: Verify Hammer build | |
run: | | |
ls -l Hammer-build | |
ls -l Hammer-install | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install -e . | |
- name: List installed Python packages | |
run: python -m pip list | |
- name: Run pre-commit | |
run: pre-commit run --all-files | |
- name: Run tests with pytest | |
run: pytest |