Skip to content

[pre-commit.ci] pre-commit autoupdate #1050

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #1050

Workflow file for this run

name: C++ Testing
on: # yamllint disable-line rule:truthy
push:
branches:
- master
pull_request:
jobs:
gtest:
runs-on: ubuntu-latest
steps:
- name: Checkout repostiory
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup packages
uses: ./.github/actions/setup
- name: Configure
run: |
export MKL_VERSION=`python -c 'from tools.mkl_ver import compatible_mkl_ver;print(compatible_mkl_ver())'`
pip install --no-cache-dir mkl-include==${MKL_VERSION} mkl-static==${MKL_VERSION}
export _BLAS_INCLUDE_DIR=`python -c 'import os;import sysconfig;data=sysconfig.get_path("data");print(f"{data}{os.sep}include")'`
export MKL_DIR=`python -c 'import os;import sysconfig;data=sysconfig.get_path("data");print(f"{data}{os.sep}lib{os.sep}cmake{os.sep}mkl")'`
mkdir build
cd build
Torch_DIR=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` cmake .. -GNinja -DBUILD_TEST=ON -DWITH_COV=ON -DCMAKE_BUILD_TYPE=DEBUG -DUSE_MKL_BLAS=ON -DBLAS_INCLUDE_DIR=$_BLAS_INCLUDE_DIR -DMKL_DIR=${MKL_DIR}
unset _BLAS_INCLUDE_DIR
cd ..
- name: Build
run: |
cd build
cmake --build .
cd ..
- name: Run tests
run: |
cd build
ctest --verbose --output-on-failure
cd ..
- name: Collect coverage
run: |
sudo apt-get install lcov
lcov --directory . --capture --output-file .coverage.info
lcov --remove .coverage.info '*/test/*' --output-file .coverage.info
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
files: .coverage.info
fail_ci_if_error: false