Skip to content

Fix for gh-1468 in arithmetic reduction when type promotion is needed #3377

Fix for gh-1468 in arithmetic reduction when type promotion is needed

Fix for gh-1468 in arithmetic reduction when type promotion is needed #3377

name: Generate coverage data
on:
pull_request:
push:
branches: [master]
jobs:
generate-coverage:
name: Generate coverage and push to Coveralls.io
runs-on: ubuntu-20.04
env:
ONEAPI_ROOT: /opt/intel/oneapi
GTEST_ROOT: /home/runner/work/googletest-1.13.0/install
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: Add Intel repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
- name: Install Intel OneAPI
run: |
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
sudo apt-get install intel-oneapi-tbb
- name: Install CMake and Ninja
run: |
sudo apt-get install ninja-build
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64
- name: Cache Gtest
id: cache-gtest
uses: actions/cache@v3
with:
path: |
/home/runner/work/googletest-1.13.0/install
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/googletest-1.13.0/install/include/gtest/*') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Gtest
if: steps.cache-gtest.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
cd /home/runner/work
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz
tar xf v1.13.0.tar.gz
cd googletest-1.13.0
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/home/runner/work/googletest-1.13.0/install
make && make install
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Lcov
run: |
sudo apt-get install lcov
- name: Install dpctl dependencies
shell: bash -l {0}
run: |
pip install numpy"<1.26.0" cython setuptools pytest pytest-cov scikit-build cmake coverage[toml]
- name: Build dpctl with coverage
shell: bash -l {0}
run: |
source /opt/intel/oneapi/setvars.sh
python scripts/gen_coverage.py
- name: Install coverall dependencies
shell: bash -l {0}
run: |
sudo gem install coveralls-lcov
pip install coveralls
- name: Upload coverage data to coveralls.io
shell: bash -l {0}
run: |
echo "Processing c-api-coverage"
export DPCTL_LCOV_FN=$(find _skbuild -name dpctl.lcov)
grep "/tmp" $DPCTL_LCOV_FN
coveralls-lcov -v -n \
$DPCTL_LCOV_FN > dpctl-c-api-coverage.json
echo "Processing pytest-coverage"
export DPCTL_PYTEST_LCOV=$(find . -name dpctl_pytest.lcov)
grep "/tmp" $DPCTL_PYTEST_LCOV
coveralls-lcov -v -n \
$DPCTL_PYTEST_LCOV > pytest-dpctl-c-api-coverage.json
echo "Merging JSON files"
python -c "import json; \
fh1 = open('dpctl-c-api-coverage.json', 'r'); \
f1 = json.load(fh1); fh1.close(); \
fh2 = open('pytest-dpctl-c-api-coverage.json', 'r'); \
f2 = json.load(fh2); fh2.close(); \
f3 = {'source_files': f1['source_files'] + f2['source_files']}; \
fh3 = open('combined-dpctl-c-api-coverage.json', 'w'); \
json.dump(f3, fh3); fh3.close()" || exit 1
# merge combined file with coverage data and upload
ls -lh dpctl-c-api-coverage.json pytest-dpctl-c-api-coverage.json \
combined-dpctl-c-api-coverage.json \
$(find _skbuild -name dpctl.lcov) $(find . -name dpctl_pytest.lcov)
echo "Merging combined files with coverage data"
coveralls --service=github --merge=combined-dpctl-c-api-coverage.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
SYCL_QUEUE_THREAD_POOL_SIZE: 6
coveralls:
name: Indicate completion to coveralls.io
needs: generate-coverage
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}