Skip to content

Commit d91b5d6

Browse files
committed
Add environment file to oneMath i/f workflow
1 parent 765f7b1 commit d91b5d6

File tree

3 files changed

+105
-86
lines changed

3 files changed

+105
-86
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
building-docs-env: 'environments/building_docs.yml'
4242
oneapi-pkgs-env: ''
4343
# Enable env when it's required to use only conda packages without OneAPI installation
44-
# oneapi-pkgs-env: 'environments/oneapi_pkgs.yml'
44+
# oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml'
4545

4646
steps:
4747
- name: Cancel Previous Runs
@@ -122,7 +122,7 @@ jobs:
122122
miniforge-version: latest
123123
use-mamba: 'true'
124124
conda-remove-defaults: 'true'
125-
environment-file: '${{ env.environment-file }}'
125+
environment-file: ${{ env.environment-file }}
126126
activate-environment: 'docs'
127127

128128
- name: ReSetup miniconda
@@ -132,7 +132,7 @@ jobs:
132132
miniforge-version: latest
133133
use-mamba: 'true'
134134
conda-remove-defaults: 'true'
135-
environment-file: '${{ env.environment-file }}'
135+
environment-file: ${{ env.environment-file }}
136136
activate-environment: 'docs'
137137

138138
- name: Conda info

.github/workflows/check-mkl-interfaces.yaml

Lines changed: 99 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,102 @@ on:
99
permissions: read-all
1010

1111
env:
12-
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
13-
TEST_ENV_NAME: 'test_onemkl_interfaces'
14-
RERUN_TESTS_ON_FAILURE: 'true'
15-
RUN_TESTS_MAX_ATTEMPTS: 2
16-
BUILD_DEP_PKGS: >-
17-
mkl-devel-dpcpp
18-
tbb-devel
19-
dpctl
20-
onedpl-devel
21-
setuptools
22-
python
23-
numpy">=2.0"
24-
cython
25-
cmake
26-
ninja
27-
scikit-build
12+
environment-file: 'environments/environment.yml'
13+
environment-file-name: 'environment.yml'
14+
environment-file-loc: '${{ github.workspace }}/environments'
15+
build-with-oneapi-env: 'environments/build_with_oneapi.yml'
16+
coverage-env: 'environments/coverage.yml'
17+
oneapi-pkgs-env: 'environments/oneapi_pkgs.yml'
18+
test-env-name: 'test_onemkl_interfaces'
19+
rerun-tests-on-failure: 'true'
20+
rerun-tests-max-attempts: 2
21+
rerun-tests-timeout: 20
2822

2923
jobs:
24+
build_env_file:
25+
name: Build conda env file
26+
27+
permissions:
28+
# Needed to cancel any previous runs that are not completed for a given workflow
29+
actions: write
30+
31+
runs-on: 'ubuntu-latest'
32+
33+
steps:
34+
- name: Cancel Previous Runs
35+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
36+
with:
37+
access_token: ${{ github.token }}
38+
39+
- name: Checkout DPNP repo
40+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Install conda-merge tool
45+
uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1
46+
with:
47+
packages: conda-merge
48+
49+
- name: Merge conda env files
50+
run: |
51+
conda-merge ${{ env.build-with-oneapi-env }} ${{ env.oneapi-pkgs-env }} > ${{ env.environment-file }}
52+
53+
- name: Upload artifact
54+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
55+
with:
56+
name: ${{ env.environment-file-name }}
57+
path: ${{ env.environment-file }}
58+
3059
test_by_tag:
3160
name: Run tests with oneMKL tag
3261

62+
needs: build_env_file
63+
3364
strategy:
65+
fail-fast: false
3466
matrix:
3567
python: ['3.13']
3668
os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
3769

38-
permissions:
39-
# Needed to cancel any previous runs that are not completed for a given workflow
40-
actions: write
41-
4270
runs-on: ${{ matrix.os }}
4371

4472
defaults:
4573
run:
4674
shell: ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
4775

48-
continue-on-error: false
49-
5076
steps:
51-
- name: Cancel Previous Runs
52-
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
53-
with:
54-
access_token: ${{ github.token }}
55-
5677
- name: Checkout DPNP repo
5778
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5879
with:
5980
fetch-depth: 0
6081

82+
- name: Download artifact
83+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
84+
with:
85+
name: ${{ env.environment-file-name }}
86+
path: ${{ env.environment-file-loc }}
87+
6188
- name: Setup miniconda
89+
id: setup_miniconda
90+
continue-on-error: true
6291
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
6392
with:
6493
miniforge-version: latest
6594
use-mamba: 'true'
66-
channels: conda-forge
6795
conda-remove-defaults: 'true'
68-
python-version: ${{ matrix.python }}
69-
activate-environment: ${{ env.TEST_ENV_NAME }}
70-
71-
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
72-
- name: Disable speed limit check in mamba
73-
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
96+
environment-file: ${{ env.environment-file }}
97+
activate-environment: ${{ env.test-env-name }}
7498

75-
- name: Install dpnp build dependencies
76-
run: |
77-
mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }}
78-
env:
79-
DPCPP_PKG: ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }}
99+
- name: ReSetup miniconda
100+
if: steps.setup_miniconda.outcome == 'failure'
101+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
102+
with:
103+
miniforge-version: latest
104+
use-mamba: 'true'
105+
conda-remove-defaults: 'true'
106+
environment-file: ${{ env.environment-file }}
107+
activate-environment: ${{ env.test-env-name }}
80108

81109
- name: Conda info
82110
run: |
@@ -92,29 +120,25 @@ jobs:
92120
python -m dpctl -f
93121
python -c "import dpnp; print(dpnp.__version__)"
94122
95-
- name: Install pytest
96-
run: |
97-
mamba install pytest ${{ env.CHANNELS }}
98-
99123
- name: Run tests
100-
if: env.RERUN_TESTS_ON_FAILURE != 'true'
124+
if: env.rerun-tests-on-failure != 'true'
101125
run: |
102126
python -m pytest -ra --pyargs dpnp.tests
103127
env:
104128
SYCL_CACHE_PERSISTENT: 1
105129

106130
- name: ReRun tests on Linux
107-
if: env.RERUN_TESTS_ON_FAILURE == 'true'
131+
if: env.rerun-tests-on-failure == 'true'
108132
id: run_tests
109133
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
110134
with:
111-
timeout_minutes: 12
112-
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
135+
timeout_minutes: ${{ env.rerun-tests-timeout }}
136+
max_attempts: ${{ env.rerun-tests-max-attempts }}
113137
retry_on: any
114138
command: |
115139
. $CONDA/etc/profile.d/conda.sh
116140
. $CONDA/etc/profile.d/mamba.sh
117-
mamba activate ${{ env.TEST_ENV_NAME }}
141+
mamba activate ${{ env.test-env-name }}
118142
119143
python -m pytest -ra --pyargs dpnp.tests
120144
env:
@@ -123,37 +147,35 @@ jobs:
123147
test_by_branch:
124148
name: Run tests with oneMKL develop branch
125149

150+
needs: build_env_file
151+
126152
strategy:
153+
fail-fast: false
127154
matrix:
128155
python: ['3.13']
129156
os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
130157

131-
permissions:
132-
# Needed to cancel any previous runs that are not completed for a given workflow
133-
actions: write
134-
135158
runs-on: ${{ matrix.os }}
136159

137160
defaults:
138161
run:
139162
shell: ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
140163

141-
continue-on-error: true
142-
143164
env:
144165
onemkl-source-dir: '${{ github.workspace }}/onemkl/'
145166

146167
steps:
147-
- name: Cancel Previous Runs
148-
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
149-
with:
150-
access_token: ${{ github.token }}
151-
152168
- name: Checkout DPNP repo
153169
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
154170
with:
155171
fetch-depth: 0
156172

173+
- name: Download artifact
174+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
175+
with:
176+
name: ${{ env.environment-file-name }}
177+
path: ${{ env.environment-file-loc }}
178+
157179
- name: Checkout oneMKL repo
158180
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
159181
with:
@@ -167,24 +189,25 @@ jobs:
167189
ls -la ${{ env.onemkl-source-dir }}
168190
169191
- name: Setup miniconda
192+
id: setup_miniconda
193+
continue-on-error: true
170194
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
171195
with:
172196
miniforge-version: latest
173197
use-mamba: 'true'
174-
channels: conda-forge
175198
conda-remove-defaults: 'true'
176-
python-version: ${{ matrix.python }}
177-
activate-environment: ${{ env.TEST_ENV_NAME }}
199+
environment-file: ${{ env.environment-file }}
200+
activate-environment: ${{ env.test-env-name }}
178201

179-
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
180-
- name: Disable speed limit check in mamba
181-
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
182-
183-
- name: Install dpnp build dependencies
184-
run: |
185-
mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }}
186-
env:
187-
DPCPP_PKG: ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }}
202+
- name: ReSetup miniconda
203+
if: steps.setup_miniconda.outcome == 'failure'
204+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
205+
with:
206+
miniforge-version: latest
207+
use-mamba: 'true'
208+
conda-remove-defaults: 'true'
209+
environment-file: ${{ env.environment-file }}
210+
activate-environment: ${{ env.test-env-name }}
188211

189212
- name: Conda info
190213
run: |
@@ -200,29 +223,25 @@ jobs:
200223
python -m dpctl -f
201224
python -c "import dpnp; print(dpnp.__version__)"
202225
203-
- name: Install pytest
204-
run: |
205-
mamba install pytest ${{ env.CHANNELS }}
206-
207226
- name: Run tests
208-
if: env.RERUN_TESTS_ON_FAILURE != 'true'
227+
if: env.rerun-tests-on-failure == 'true'
209228
run: |
210229
python -m pytest -ra --pyargs dpnp.tests
211230
env:
212231
SYCL_CACHE_PERSISTENT: 1
213232

214233
- name: ReRun tests on Linux
215-
if: env.RERUN_TESTS_ON_FAILURE == 'true'
234+
if: env.rerun-tests-on-failure == 'true'
216235
id: run_tests
217236
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
218237
with:
219-
timeout_minutes: 15
220-
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
238+
timeout_minutes: ${{ env.rerun-tests-timeout }}
239+
max_attempts: ${{ env.rerun-tests-max-attempts }}
221240
retry_on: any
222241
command: |
223242
. $CONDA/etc/profile.d/conda.sh
224243
. $CONDA/etc/profile.d/mamba.sh
225-
mamba activate ${{ env.TEST_ENV_NAME }}
244+
mamba activate ${{ env.test-env-name }}
226245
227246
python -m pytest -ra --pyargs dpnp.tests
228247
env:

.github/workflows/generate_coverage.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
coverage-env: 'environments/coverage.yml'
2626
oneapi-pkgs-env: ''
2727
# Enable env when it's required to use only conda packages without OneAPI installation
28-
# oneapi-pkgs-env: 'environments/oneapi_pkgs.yml'
28+
# oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml'
2929

3030
steps:
3131
- name: Cancel Previous Runs
@@ -81,7 +81,7 @@ jobs:
8181
miniforge-version: latest
8282
use-mamba: 'true'
8383
conda-remove-defaults: 'true'
84-
environment-file: '${{ env.environment-file }}'
84+
environment-file: ${{ env.environment-file }}
8585
activate-environment: 'coverage'
8686

8787
- name: ReSetup miniconda
@@ -91,7 +91,7 @@ jobs:
9191
miniforge-version: latest
9292
use-mamba: 'true'
9393
conda-remove-defaults: 'true'
94-
environment-file: '${{ env.environment-file }}'
94+
environment-file: ${{ env.environment-file }}
9595
activate-environment: 'coverage'
9696

9797
- name: Conda info

0 commit comments

Comments
 (0)