-
Notifications
You must be signed in to change notification settings - Fork 42
60 lines (47 loc) · 1.77 KB
/
cpp_testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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