Skip to content

Commit

Permalink
Add environment file to coverage workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jan 14, 2025
1 parent 35b154b commit f6baa58
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 50 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ jobs:

env:
environment-file: 'environments/environment.yml'
base-doc-env: 'environments/base_build_docs.yml'
build-pkgs-env: ''
build-with-oneapi-env: 'environments/build_with_oneapi.yml'
building-docs-env: 'environments/building_docs.yml'
oneapi-pkgs-env: ''
# Enable env when it's required to use only conda packages without OneAPI installation
# build-pkgs-env: 'environments/build_pkgs.yml'
# oneapi-pkgs-env: 'environments/oneapi_pkgs.yml'

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -108,7 +109,7 @@ jobs:

- name: Merge conda env files
run: |
conda-merge ${{ env.base-doc-env }} ${{ env.build-pkgs-env }} > ${{ env.environment-file }}
conda-merge ${{ env.build-with-oneapi }} ${{ env.building-docs-env }} ${{ env.oneapi-pkgs-env }} > ${{ env.environment-file }}
cat ${{ env.environment-file }}
- name: Setup miniconda
Expand Down
67 changes: 29 additions & 38 deletions .github/workflows/generate_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,20 @@ jobs:
shell: bash -el {0}

env:
python-ver: '3.12'
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
NO_INTEL_CHANNELS: '-c dppy/label/dev -c conda-forge --override-channels'
# Install the latest oneAPI compiler to work around an issue
INSTALL_ONE_API: 'yes'
environment-file: 'environments/environment.yml'
build-with-oneapi-env: 'environments/build_with_oneapi.yml'
coverage-env: 'environments/coverage.yml'
oneapi-pkgs-env: ''
# Enable env when it's required to use only conda packages without OneAPI installation
# oneapi-pkgs-env: 'environments/oneapi_pkgs.yml'

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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.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.PUB
cat GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
Expand All @@ -47,7 +42,6 @@ jobs:
sudo apt update
- name: Install latest Intel OneAPI
if: env.INSTALL_ONE_API == 'yes'
run: |
sudo apt install hwloc \
intel-oneapi-mkl \
Expand All @@ -60,6 +54,22 @@ jobs:
- name: Install Lcov
run: |
sudo apt-get install lcov
sudo gem install coveralls-lcov
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Install conda-merge tool
uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1
with:
packages: conda-merge

- name: Merge conda env files
run: |
conda-merge ${{ env.build-with-oneapi }} ${{ env.coverage-env }} ${{ env.oneapi-pkgs-env }} > ${{ env.environment-file }}
cat ${{ env.environment-file }}
- name: Setup miniconda
id: setup_miniconda
Expand All @@ -68,9 +78,8 @@ jobs:
with:
miniforge-version: latest
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ env.python-ver }}
environment-file: '${{ env.environment-file }}'
activate-environment: 'coverage'

- name: ReSetup miniconda
Expand All @@ -79,27 +88,10 @@ jobs:
with:
miniforge-version: latest
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ env.python-ver }}
environment-file: '${{ env.environment-file }}'
activate-environment: 'coverage'

# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
- name: Disable speed limit check in mamba
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV

- name: Install dpnp dependencies
if: env.INSTALL_ONE_API == 'yes'
run: |
mamba install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
dpctl">=0.18.0dev0" ${{ env.NO_INTEL_CHANNELS }}
- name: Install dpnp dependencies
if: env.INSTALL_ONE_API != 'yes'
run: |
mamba install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
dpctl">=0.18.0dev0" dpcpp_linux-64 mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
- name: Conda info
run: |
mamba info
Expand All @@ -122,12 +114,7 @@ jobs:
- 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==4.0.1
echo "Total number of coverage attempts: ${{ steps.build_coverage.outputs.total_attempts }}"
- name: Upload coverage data to coveralls.io
run: |
Expand All @@ -144,9 +131,13 @@ jobs:

coveralls:
name: Indicate completion to coveralls.io

needs: generate-coverage

runs-on: ubuntu-latest

container: python:3-slim

steps:
- name: Finished
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
name: Base building docs env
name: Packages to build DPNP with OneAPI env activated
channels:
- dppy/label/dev
- conda-forge
dependencies:
- python=3.12
- cmake
- cupy
- cython
- dpctl>=0.19.0dev0
- ninja
- numpy
- pytest
- scikit-build
- sphinx
- sphinx_rtd_theme
- pip:
- -r base_build_docs.txt
10 changes: 10 additions & 0 deletions environments/building_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Building docs specific packages
channels:
- conda-forge
dependencies:
- python=3.12
- cupy
- sphinx
- sphinx_rtd_theme
- pip:
- -r base_build_docs.txt
1 change: 1 addition & 0 deletions environments/coverage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coveralls==4.0.1
10 changes: 10 additions & 0 deletions environments/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Coverage specific packages
channels:
- conda-forge
dependencies:
- python=3.12
- coverage[toml]
- llvm
- pytest-cov
- pip:
- -r coverage.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Packages to build DPNP
name: OneAPI packages to build DPNP without OneAPI env activated
channels:
- https://software.repos.intel.com/python/conda/
dependencies:
Expand Down

0 comments on commit f6baa58

Please sign in to comment.