Skip to content

Commit

Permalink
Add environment file to build docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jan 13, 2025
1 parent 9d445ba commit 37a8ab6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 35 deletions.
52 changes: 17 additions & 35 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ 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'
env-file: '${{ github.workspace }}/env.yml'
base-doc-env: 'environments/base_build_docs.yml'
build-pkgs-env: ''
# Enable env when it's required to use only conda packages without OneAPI installation
# build-pkgs-env: 'environments/build_pkgs.yml'

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -101,16 +101,25 @@ jobs:
with:
fetch-depth: 0

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

- name: Install conda-merge tool
run: |
conda-merge ${{ env.base-doc-env }} ${{ env.build-pkgs-env }} > ${{ env.env-file }}
cat ${{ env.env-file }}
- name: Setup miniconda
id: setup_miniconda
continue-on-error: true
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ env.python-ver }}
environment-file: '${{ env.env-file }}'
activate-environment: 'docs'

- name: ReSetup miniconda
Expand All @@ -119,35 +128,10 @@ jobs:
with:
miniforge-version: latest
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ env.python-ver }}
environment-file: '${{ env.env-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 +162,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@cbe72c8e402e8a3faa1f0b247ef90aa6c8e4ce74 # v1.9.8
with:
Expand All @@ -187,7 +170,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
3 changes: 3 additions & 0 deletions environments/base_build_docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pyenchant==3.2.2
sphinxcontrib-googleanalytics==0.4
sphinxcontrib-spelling==8.0.1
18 changes: 18 additions & 0 deletions environments/base_build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Base building docs env
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
8 changes: 8 additions & 0 deletions environments/build_pkgs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Packages to build DPNP
channels:
- https://software.repos.intel.com/python/conda/
dependencies:
- dpcpp_linux-64
- mkl-devel-dpcpp
- onedpl-devel
- tbb-devel

0 comments on commit 37a8ab6

Please sign in to comment.