Return container to avoid administrative requirements. #14
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: ubuntu:latest | |
steps: | |
- id: checkout | |
name: Checkout source code | |
uses: actions/checkout@v4 | |
- id: configure_apt | |
name: Configure apt recommendations | |
run: | | |
echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf | |
echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf | |
- id: install_packages | |
name: Install third-party libraries | |
run: | | |
apt-get update | |
apt-get install -y libunwind-dev | |
apt-get install -y cmake build-essential libboost-test-dev libfmt-dev python3-torch | |
- name: Find PyTorch installation path | |
id: find_libtorch | |
run: > | |
echo "cmake_prefix_path=$(python3 -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" |