Skip to content

Add environment file to GitHub workflows #2258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 20 additions & 35 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ jobs:
pull-requests: write

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'
building-docs-env: 'environments/building_docs.yml'
oneapi-pkgs-env: ''
# Enable env when it's required to use only conda packages without OneAPI installation
# oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml'

steps:
- name: Cancel Previous Runs
Expand All @@ -60,6 +61,7 @@ jobs:
docker-images: false

- name: Add Intel repository
if: env.oneapi-pkgs-env == ''
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 @@ -75,6 +77,7 @@ jobs:
sudo apt install --reinstall -y gcc-9 g++-9 libstdc++-9-dev

- name: Install Intel OneAPI
if: env.oneapi-pkgs-env == ''
run: |
sudo apt install hwloc \
intel-oneapi-mkl \
Expand All @@ -101,16 +104,25 @@ jobs:
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 }} ${{ env.building-docs-env }} ${{ env.oneapi-pkgs-env }} > ${{ env.environment-file }}
cat ${{ env.environment-file }}

- name: Setup miniconda
id: setup_miniconda
continue-on-error: true
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
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: 'docs'

- name: ReSetup miniconda
Expand All @@ -119,35 +131,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: 'docs'

# 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 sphinx dependencies
run: |
mamba install sphinx sphinx_rtd_theme
pip install sphinxcontrib-googleanalytics==0.4 \
pyenchant sphinxcontrib-spelling

- name: Install dpnp dependencies
if: env.INSTALL_ONE_API == 'yes'
run: |
mamba install numpy dpctl">=0.18.0dev0" cmake cython pytest ninja scikit-build ${{ env.NO_INTEL_CHANNELS }}

- name: Install dpnp dependencies
if: env.INSTALL_ONE_API != 'yes'
run: |
mamba install numpy dpctl">=0.18.0dev0" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
cmake cython pytest ninja scikit-build ${{ env.CHANNELS }}

- name: Install cuPy dependencies
run: mamba install cupy

- name: Conda info
run: mamba info

Expand Down Expand Up @@ -178,7 +165,6 @@ jobs:
echo PROJECT_NUMBER=${PROJECT_NUMBER}
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> $GITHUB_ENV

# https://github.com/marketplace/actions/doxygen-action
- name: Build backend docs
uses: mattnotmitt/doxygen-action@b84fe17600245bb5db3d6c247cc274ea98c15a3b # v1.12
with:
Expand All @@ -187,7 +173,6 @@ jobs:
- name: Copy backend docs
run: cp -r dpnp/backend/doc/html ${{ env.PUBLISH_DIR }}/backend_doc

# https://github.com/marketplace/actions/github-pages-action
# The step is only used to build docs while pushing a PR to "master"
- name: Deploy docs
if: env.GH_EVENT_PUSH_UPSTREAM == 'true'
Expand Down
Loading
Loading