version 0.9.6 #4
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: Build and Test | |
on: [ pull_request ] | |
concurrency: | |
group: tests-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-run-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- os: ubuntu-22.04 | |
compiler: clang-17 | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.compiler }}) | |
steps: | |
- name: Install tools | |
run: | | |
sudo apt-get install -y wget unzip | |
- name: Add repos for for gcc-13 and clang-17 | |
run: | | |
# gcc-13 | |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
# clang-17 | |
source /etc/os-release | |
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-17 main" | sudo tee /etc/apt/sources.list.d/llvm-17.list | |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm.gpg > /dev/null | |
- name: Ensure stdlib version | |
run: | | |
sudo apt-get install -y libstdc++-13-dev | |
- name: Get minimum cmake version | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: 3.30.5 | |
- name: Install compiler | |
id: install_cc | |
uses: rlalik/[email protected] | |
with: | |
compiler: ${{ matrix.config.compiler }} | |
- name: Check compiler | |
shell: bash | |
env: | |
CC: ${{ steps.install_cc.outputs.cc }} | |
CXX: ${{ steps.install_cc.outputs.cxx }} | |
run: | | |
$CC --version | |
$CXX --version | |
- uses: rui314/setup-mold@v1 | |
- name: install conan | |
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/configure_conan@main | |
with: | |
conan-version: 2.3.1 | |
- name: add conan user | |
run: | | |
conan remote add -f dice-group https://conan.dice-research.org/artifactory/api/conan/tentris | |
- name: Cache conan data | |
id: cache-conan | |
uses: actions/cache@v3 | |
with: | |
path: ~/.conan/data | |
key: ${{ matrix.config.os }}-${{ matrix.config.compiler }}-testing-conan | |
- name: Cache torch | |
id: cache-torch | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/libtorch | |
key: cached-torch | |
# note: newer versions of libtorch than 1.09.0 result in an "error: arithmetic on a pointer to an incomplete type 'c10::IValue'" when building with clang-14 and libstdc++-12 | |
- name: Download torch | |
if: steps.cache-torch.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
mkdir -p ~/.cache/ | |
wget --continue --timestamping -O ~/.cache/libtorch-cxx11-abi-shared-with-deps-1.09.0+cpu.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.0%2Bcpu.zip | |
unzip ~/.cache/libtorch-cxx11-abi-shared-with-deps-1.09.0+cpu.zip -d ~/.cache | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get dependency provider | |
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/add_conan_provider@main | |
- name: Configure CMake | |
id: configure-cmake | |
shell: bash | |
env: | |
CC: ${{ steps.install_cc.outputs.cc }} | |
CXX: ${{ steps.install_cc.outputs.cxx }} | |
run: | | |
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="conan_provider.cmake" -DCMAKE_CXX_FLAGS="-Wno-unused-command-line-argument -fuse-ld=mold -march=native" -DBUILD_TESTING=On -DLIBTORCH_PATH=~/.cache/libtorch -G Ninja -B build . | |
- name: Build tests | |
id: compile-tests | |
shell: bash | |
working-directory: build | |
env: | |
CC: ${{ steps.install_cc.outputs.cc }} | |
CXX: ${{ steps.install_cc.outputs.cxx }} | |
run: cmake --build . --parallel $(nproc) | |
- name: Run tests | |
id: run-tests | |
shell: bash | |
working-directory: build | |
run: ctest --timeout 3000 --parallel $(nproc) --exclude-regex "(tests_RawHypertrieContext_systematic)|(tests_RawHypertrieContext_systematic_metall)|(tests_RawHypertrieContext_randomized_abort)|(tests_HypertrieContext_systematic_metall)|(tests_Einsum_metall)" |