Find torch libraries. #12
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: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
container: | |
image: pytorch/pytorch:latest | |
steps: | |
- id: checkout | |
name: Checkout source code | |
uses: actions/checkout@v4 | |
- id: install_packages | |
name: Install third-party libraries | |
run: | | |
apt-get update | |
apt-get install -y libunwind-dev --no-install-recommends | |
apt-get install -y cmake build-essential libboost-test-dev libfmt-dev --no-install-recommends | |
- name: Find PyTorch installation path | |
id: find_libtorch | |
run: | | |
echo "cmake_prefix_path=$(python -c 'import torch; print(torch.utils.cmake_prefix_path)')" >> $GITHUB_OUTPUT | |
- name: Configure CMake | |
run: cmake -DCMAKE_PREFIX_PATH=${{steps.find_libtorch.outputs.cmake_prefix_path}} -B ${{github.workspace}}/build | |
- name: Build | |
run: cmake -DCMAKE_PREFIX_PATH=${{steps.find_libtorch.outputs.cmake_prefix_path}} --build ${{github.workspace}}/build | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: make test ARGS=--verbose" |