build.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: openfhe-rs
  2. on: [push, pull_request]
  3. env:
  4. CARGO_TERM_COLOR: always
  5. jobs:
  6. openfhe-rs:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: Clone Git repository
  10. uses: actions/checkout@v4
  11. - name: Install Cmake
  12. run: |
  13. sudo apt update
  14. sudo apt-get install -y cmake
  15. - name: Build and install OpenFHE
  16. run: |
  17. git clone https://github.com/openfheorg/openfhe-development.git
  18. cd openfhe-development
  19. mkdir install
  20. cmake -B ${OPENFHE_BUILD:-build} -DBUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install .
  21. make -C ${OPENFHE_BUILD:-build} -j$(nproc)
  22. make -C ${OPENFHE_BUILD:-build} install
  23. - name: Install Rust
  24. uses: dtolnay/rust-toolchain@stable
  25. with:
  26. toolchain: stable-gnu
  27. - name: Build openfhe-rs
  28. run: |
  29. cargo build --verbose
  30. - name: Test openfhe-rs
  31. run: |
  32. LD_LIBRARY_PATH=`pwd`/openfhe-development/install/lib cargo test -- --test-threads=1
  33. - name: Examples openfhe-rs
  34. run: |
  35. LD_LIBRARY_PATH=`pwd`/openfhe-development/install/lib cargo run --example polynomial_evaluation
  36. LD_LIBRARY_PATH=`pwd`/openfhe-development/install/lib cargo run --example function_evaluation
  37. LD_LIBRARY_PATH=`pwd`/openfhe-development/install/lib cargo run --example simple_integers
  38. LD_LIBRARY_PATH=`pwd`/openfhe-development/install/lib cargo run --example simple_real_numbers