Skip to content

Commit d8fc33f

Browse files
committed
Add environment file to build docs workflow
1 parent 9d445ba commit d8fc33f

File tree

4 files changed

+43
-35
lines changed

4 files changed

+43
-35
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
pull-requests: write
3737

3838
env:
39-
python-ver: '3.12'
40-
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
41-
NO_INTEL_CHANNELS: '-c dppy/label/dev -c conda-forge --override-channels'
42-
# Install the latest oneAPI compiler to work around an issue
43-
INSTALL_ONE_API: 'yes'
39+
env-file: '${{ github.workspace }}/env.yml'
40+
base-doc-env: 'environments/base_build_docs.yml'
41+
build-pkgs-env: ''
42+
# Enable env when it's required to use only conda packages without OneAPI installation
43+
# build-pkgs-env: 'environments/build_pkgs.yml'
4444

4545
steps:
4646
- name: Cancel Previous Runs
@@ -101,16 +101,22 @@ jobs:
101101
with:
102102
fetch-depth: 0
103103

104+
- name: Install conda-merge tool
105+
uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1
106+
with:
107+
packages: |
108+
conda-merge ${{ env.base-doc-env }} ${{ env.build-pkgs-env }} > ${{ env.env-file }}
109+
cat ${{ env.env-file }}
110+
104111
- name: Setup miniconda
105112
id: setup_miniconda
106113
continue-on-error: true
107114
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
108115
with:
109116
miniforge-version: latest
110117
use-mamba: 'true'
111-
channels: conda-forge
112118
conda-remove-defaults: 'true'
113-
python-version: ${{ env.python-ver }}
119+
environment-file: '${{ env.env-file }}'
114120
activate-environment: 'docs'
115121

116122
- name: ReSetup miniconda
@@ -119,35 +125,10 @@ jobs:
119125
with:
120126
miniforge-version: latest
121127
use-mamba: 'true'
122-
channels: conda-forge
123128
conda-remove-defaults: 'true'
124-
python-version: ${{ env.python-ver }}
129+
environment-file: '${{ env.env-file }}'
125130
activate-environment: 'docs'
126131

127-
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
128-
- name: Disable speed limit check in mamba
129-
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
130-
131-
- name: Install sphinx dependencies
132-
run: |
133-
mamba install sphinx sphinx_rtd_theme
134-
pip install sphinxcontrib-googleanalytics==0.4 \
135-
pyenchant sphinxcontrib-spelling
136-
137-
- name: Install dpnp dependencies
138-
if: env.INSTALL_ONE_API == 'yes'
139-
run: |
140-
mamba install numpy dpctl">=0.18.0dev0" cmake cython pytest ninja scikit-build ${{ env.NO_INTEL_CHANNELS }}
141-
142-
- name: Install dpnp dependencies
143-
if: env.INSTALL_ONE_API != 'yes'
144-
run: |
145-
mamba install numpy dpctl">=0.18.0dev0" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
146-
cmake cython pytest ninja scikit-build ${{ env.CHANNELS }}
147-
148-
- name: Install cuPy dependencies
149-
run: mamba install cupy
150-
151132
- name: Conda info
152133
run: mamba info
153134

@@ -178,7 +159,6 @@ jobs:
178159
echo PROJECT_NUMBER=${PROJECT_NUMBER}
179160
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> $GITHUB_ENV
180161
181-
# https://github.com/marketplace/actions/doxygen-action
182162
- name: Build backend docs
183163
uses: mattnotmitt/doxygen-action@cbe72c8e402e8a3faa1f0b247ef90aa6c8e4ce74 # v1.9.8
184164
with:
@@ -187,7 +167,6 @@ jobs:
187167
- name: Copy backend docs
188168
run: cp -r dpnp/backend/doc/html ${{ env.PUBLISH_DIR }}/backend_doc
189169

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

environments/base_build_docs.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pyenchant==3.2.2
2+
sphinxcontrib-googleanalytics==0.4
3+
sphinxcontrib-spelling==8.0.1

environments/base_build_docs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Base building docs env
2+
channels:
3+
- dppy/label/dev
4+
- conda-forge
5+
dependencies:
6+
- python=3.12
7+
- cmake
8+
- cupy
9+
- cython
10+
- dpctl>=0.19.0dev0
11+
- ninja
12+
- numpy
13+
- pytest
14+
- scikit-build
15+
- sphinx
16+
- sphinx_rtd_theme
17+
- pip:
18+
- -r base_build_docs.txt

environments/build_pkgs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Packages to build DPNP
2+
channels:
3+
- https://software.repos.intel.com/python/conda/
4+
dependencies:
5+
- dpcpp_linux-64
6+
- mkl-devel-dpcpp
7+
- onedpl-devel
8+
- tbb-devel

0 commit comments

Comments
 (0)