85
85
shell : bash -l {0}
86
86
run : |
87
87
source /opt/intel/oneapi/setvars.sh
88
- export _SAVED_PATH=${PATH}
89
- export PATH=$(dirname $(dirname $(which icx)))/bin-llvm:${PATH}
90
- python setup.py develop -- \
91
- -G "Ninja" \
92
- -DCMAKE_BUILD_TYPE=Debug \
93
- -DCMAKE_C_COMPILER:PATH=icx \
94
- -DCMAKE_CXX_COMPILER:PATH=icpx \
95
- -DDPCTL_ENABLE_L0_PROGRAM_CREATION=ON \
96
- -DDPCTL_GENERATE_COVERAGE=ON \
97
- -DDPCTL_BUILD_CAPI_TESTS=ON \
98
- -DDPCTL_COVERAGE_REPORT_OUTPUT_DIR=$(pwd)
99
- pushd $(find _skbuild -name cmake-build)
100
- cmake --build . --target lcov-genhtml || exit 1
101
- popd
102
- export PATH=${_SAVED_PATH}
103
- unset _SAVED_PATH
104
- python -c "import dpctl; print(dpctl.__version__); dpctl.lsplatform()" || exit 1
105
- export LLVM_PROFILE_FILE="dpctl_pytest.profraw"
106
- pytest -q -ra --disable-warnings --cov-config pyproject.toml --cov dpctl \
107
- --cov-report term-missing --pyargs dpctl -vv \
108
- --ignore=dpctl/tensor/libtensor/tests || exit 1
109
- $(dirname $(dirname $(which icx)))/bin-llvm/llvm-profdata merge \
110
- -sparse ${LLVM_PROFILE_FILE} -o dpctl_pytest.profdata || exit 1
111
-
88
+ python scripts/gen_coverage.py
112
89
113
90
- name : Install coverall dependencies
114
91
shell : bash -l {0}
@@ -120,9 +97,18 @@ jobs:
120
97
shell : bash -l {0}
121
98
run : |
122
99
coveralls-lcov -v -n \
123
- $(find _skbuild -name dpctl.lcov) \
124
- $(find . -name dpctl_pytest.lcov) > dpctl-c-api-coverage.json
125
- coveralls --service=github --merge=dpctl-c-api-coverage.json
100
+ $(find _skbuild -name dpctl.lcov) > dpctl-c-api-coverage.json
101
+ coveralls-lcov -v -n \
102
+ $(find . -name dpctl_pytest.lcov) > pytest-dpctl-c-api-coverage.json
103
+ # merge json files
104
+ python -c "import json; \
105
+ f1 = json.load('dpctl-c-api-coverage.json"); \
106
+ f2 = json.load('pytest-dpctl-c-api-coverage.json"); \
107
+ f3 = {'source_files': f1['source_files'] + f2['source_files']}; \
108
+ fh = open('combined-dpctl-c-api-coverage.json', 'w'); \
109
+ json.dump(f3, fh); fh.close()" || exit 1
110
+ # merge combined file with coverage data and upload
111
+ coveralls --service=github --merge=combined-dpctl-c-api-coverage.json
126
112
env :
127
113
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128
114
COVERALLS_PARALLEL : true
0 commit comments