Leverage dpnp.cumsum
through dpctl.tensor implementation
#2045
Workflow file for this run
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: Generate coverage data for dpnp | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
permissions: read-all | |
jobs: | |
generate-coverage: | |
name: Generate coverage and push to Coveralls.io | |
runs-on: ubuntu-20.04 | |
permissions: | |
# Needed to cancel any previous runs that are not completed for a given workflow | |
actions: write | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
python-ver: '3.10' | |
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels' | |
# Install the latest oneAPI compiler to work around an issue | |
INSTALL_ONE_API: 'yes' | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout repo | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | |
with: | |
fetch-depth: 0 | |
- name: Add Intel repository | |
if: env.INSTALL_ONE_API == 'yes' | |
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 latest Intel OneAPI | |
if: env.INSTALL_ONE_API == 'yes' | |
run: | | |
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp | |
sudo apt-get install intel-oneapi-mkl-devel | |
sudo apt-get install intel-oneapi-tbb-devel | |
- name: Install Lcov | |
run: | | |
sudo apt-get install lcov | |
- name: Setup miniconda | |
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ env.python-ver }} | |
miniconda-version: 'latest' | |
activate-environment: 'coverage' | |
- name: Install dpnp dependencies | |
if: env.INSTALL_ONE_API == 'yes' | |
run: | | |
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \ | |
dpctl">=0.17.0dev0" onedpl-devel ${{ env.CHANNELS }} | |
- name: Install dpnp dependencies | |
if: env.INSTALL_ONE_API != 'yes' | |
run: | | |
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \ | |
dpctl">=0.17.0dev0" dpcpp_linux-64 mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }} | |
- name: Conda info | |
run: | | |
conda info | |
conda list | |
- name: Build dpnp with coverage | |
id: build_coverage | |
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 | |
with: | |
shell: bash | |
timeout_minutes: 60 | |
max_attempts: 5 | |
retry_on: error | |
command: | | |
. $CONDA/etc/profile.d/conda.sh | |
conda activate coverage | |
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
git clean -fxd | |
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py" --verbose | |
- name: Total number of coverage attempts | |
run: | | |
echo "Total number of coverage attempts made: ${{ steps.build_coverage.outputs.total_attempts }}" | |
- name: Install coverall dependencies | |
run: | | |
sudo gem install coveralls-lcov | |
pip install coveralls==3.3.1 | |
- name: Upload coverage data to coveralls.io | |
run: | | |
echo "Processing pytest-coverage" | |
export DPNP_PYTEST_LCOV=$(find . -name dpnp_pytest.lcov) | |
coveralls-lcov -v -n $DPNP_PYTEST_LCOV > pytest-dpnp-c-api-coverage.json | |
# merge file with coverage data and upload | |
echo "Merging files with coverage data" | |
coveralls --service=github --merge=pytest-dpnp-c-api-coverage.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: true | |
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==3.3.1 | |
coveralls --service=github --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |