9
9
permissions : read-all
10
10
11
11
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
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
+ oneapi-pkgs-env : ' environments/oneapi_pkgs.yml'
17
+ test-env-name : ' test_onemkl_interfaces'
18
+ rerun-tests-on-failure : ' true'
19
+ rerun-tests-max-attempts : 2
20
+ rerun-tests-timeout : 20
28
21
29
22
jobs :
23
+ build_env_file :
24
+ name : Build conda env file
25
+
26
+ permissions :
27
+ # Needed to cancel any previous runs that are not completed for a given workflow
28
+ actions : write
29
+
30
+ runs-on : ' ubuntu-latest'
31
+
32
+ steps :
33
+ - name : Cancel Previous Runs
34
+ uses : styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
35
+ with :
36
+ access_token : ${{ github.token }}
37
+
38
+ - name : Checkout DPNP repo
39
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40
+ with :
41
+ fetch-depth : 0
42
+
43
+ - name : Install conda-merge tool
44
+ uses : BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1
45
+ with :
46
+ packages : conda-merge
47
+
48
+ - name : Merge conda env files
49
+ run : |
50
+ conda-merge ${{ env.build-with-oneapi-env }} ${{ env.oneapi-pkgs-env }} > ${{ env.environment-file }}
51
+
52
+ - name : Upload artifact
53
+ uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
54
+ with :
55
+ name : ${{ env.environment-file-name }}
56
+ path : ${{ env.environment-file }}
57
+
30
58
test_by_tag :
31
59
name : Run tests with oneMKL tag
32
60
61
+ needs : build_env_file
62
+
33
63
strategy :
64
+ fail-fast : false
34
65
matrix :
35
66
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
36
67
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
37
68
python : ['3.12']
38
69
os : [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
39
70
40
- permissions :
41
- # Needed to cancel any previous runs that are not completed for a given workflow
42
- actions : write
43
-
44
71
runs-on : ${{ matrix.os }}
45
72
46
73
defaults :
47
74
run :
48
75
shell : ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
49
76
50
- continue-on-error : false
51
-
52
77
steps :
53
- - name : Cancel Previous Runs
54
- uses : styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
55
- with :
56
- access_token : ${{ github.token }}
57
-
58
78
- name : Checkout DPNP repo
59
79
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60
80
with :
61
81
fetch-depth : 0
62
82
83
+ - name : Download artifact
84
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
85
+ with :
86
+ name : ${{ env.environment-file-name }}
87
+ path : ${{ env.environment-file-loc }}
88
+
63
89
- name : Setup miniconda
90
+ id : setup_miniconda
91
+ continue-on-error : true
64
92
uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
65
93
with :
66
94
miniforge-version : latest
67
95
use-mamba : ' true'
68
- channels : conda-forge
69
96
conda-remove-defaults : ' true'
70
- python-version : ${{ matrix.python }}
71
- activate-environment : ${{ env.TEST_ENV_NAME }}
72
-
73
- # Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
74
- - name : Disable speed limit check in mamba
75
- run : echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
97
+ environment-file : ${{ env.environment-file }}
98
+ activate-environment : ${{ env.test-env-name }}
76
99
77
- - name : Install dpnp build dependencies
78
- run : |
79
- mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }}
80
- env :
81
- DPCPP_PKG : ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }}
100
+ - name : ReSetup miniconda
101
+ if : steps.setup_miniconda.outcome == 'failure'
102
+ uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
103
+ with :
104
+ miniforge-version : latest
105
+ use-mamba : ' true'
106
+ conda-remove-defaults : ' true'
107
+ environment-file : ${{ env.environment-file }}
108
+ activate-environment : ${{ env.test-env-name }}
82
109
83
110
- name : Conda info
84
111
run : |
@@ -94,29 +121,25 @@ jobs:
94
121
python -m dpctl -f
95
122
python -c "import dpnp; print(dpnp.__version__)"
96
123
97
- - name : Install pytest
98
- run : |
99
- mamba install pytest ${{ env.CHANNELS }}
100
-
101
124
- name : Run tests
102
- if : env.RERUN_TESTS_ON_FAILURE != 'true'
125
+ if : env.rerun-tests-on-failure != 'true'
103
126
run : |
104
127
python -m pytest -ra --pyargs dpnp.tests
105
128
env :
106
129
SYCL_CACHE_PERSISTENT : 1
107
130
108
131
- name : ReRun tests on Linux
109
- if : env.RERUN_TESTS_ON_FAILURE == 'true'
132
+ if : env.rerun-tests-on-failure == 'true'
110
133
id : run_tests
111
134
uses : nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
112
135
with :
113
- timeout_minutes : 12
114
- max_attempts : ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
136
+ timeout_minutes : ${{ env.rerun-tests-timeout }}
137
+ max_attempts : ${{ env.rerun-tests-max-attempts }}
115
138
retry_on : any
116
139
command : |
117
140
. $CONDA/etc/profile.d/conda.sh
118
141
. $CONDA/etc/profile.d/mamba.sh
119
- mamba activate ${{ env.TEST_ENV_NAME }}
142
+ mamba activate ${{ env.test-env-name }}
120
143
121
144
python -m pytest -ra --pyargs dpnp.tests
122
145
env :
@@ -125,39 +148,37 @@ jobs:
125
148
test_by_branch :
126
149
name : Run tests with oneMKL develop branch
127
150
151
+ needs : build_env_file
152
+
128
153
strategy :
154
+ fail-fast : false
129
155
matrix :
130
156
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
131
157
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
132
158
python : ['3.12']
133
159
os : [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
134
160
135
- permissions :
136
- # Needed to cancel any previous runs that are not completed for a given workflow
137
- actions : write
138
-
139
161
runs-on : ${{ matrix.os }}
140
162
141
163
defaults :
142
164
run :
143
165
shell : ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
144
166
145
- continue-on-error : true
146
-
147
167
env :
148
168
onemkl-source-dir : ' ${{ github.workspace }}/onemkl/'
149
169
150
170
steps :
151
- - name : Cancel Previous Runs
152
- uses : styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
153
- with :
154
- access_token : ${{ github.token }}
155
-
156
171
- name : Checkout DPNP repo
157
172
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
158
173
with :
159
174
fetch-depth : 0
160
175
176
+ - name : Download artifact
177
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
178
+ with :
179
+ name : ${{ env.environment-file-name }}
180
+ path : ${{ env.environment-file-loc }}
181
+
161
182
- name : Checkout oneMKL repo
162
183
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
163
184
with :
@@ -171,24 +192,25 @@ jobs:
171
192
ls -la ${{ env.onemkl-source-dir }}
172
193
173
194
- name : Setup miniconda
195
+ id : setup_miniconda
196
+ continue-on-error : true
174
197
uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
175
198
with :
176
199
miniforge-version : latest
177
200
use-mamba : ' true'
178
- channels : conda-forge
179
201
conda-remove-defaults : ' true'
180
- python-version : ${{ matrix.python }}
181
- activate-environment : ${{ env.TEST_ENV_NAME }}
202
+ environment-file : ${{ env.environment-file }}
203
+ activate-environment : ${{ env.test-env-name }}
182
204
183
- # Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
184
- - name : Disable speed limit check in mamba
185
- run : echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
186
-
187
- - name : Install dpnp build dependencies
188
- run : |
189
- mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }}
190
- env :
191
- DPCPP_PKG : ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }}
205
+ - name : ReSetup miniconda
206
+ if : steps.setup_miniconda.outcome == 'failure'
207
+ uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
208
+ with :
209
+ miniforge-version : latest
210
+ use-mamba : ' true '
211
+ conda-remove-defaults : ' true '
212
+ environment-file : ${{ env.environment-file }}
213
+ activate-environment : ${{ env.test-env-name }}
192
214
193
215
- name : Conda info
194
216
run : |
@@ -204,29 +226,25 @@ jobs:
204
226
python -m dpctl -f
205
227
python -c "import dpnp; print(dpnp.__version__)"
206
228
207
- - name : Install pytest
208
- run : |
209
- mamba install pytest ${{ env.CHANNELS }}
210
-
211
229
- name : Run tests
212
- if : env.RERUN_TESTS_ON_FAILURE ! = 'true'
230
+ if : env.rerun-tests-on-failure = = 'true'
213
231
run : |
214
232
python -m pytest -ra --pyargs dpnp.tests
215
233
env :
216
234
SYCL_CACHE_PERSISTENT : 1
217
235
218
236
- name : ReRun tests on Linux
219
- if : env.RERUN_TESTS_ON_FAILURE == 'true'
237
+ if : env.rerun-tests-on-failure == 'true'
220
238
id : run_tests
221
239
uses : nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
222
240
with :
223
- timeout_minutes : 15
224
- max_attempts : ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
241
+ timeout_minutes : ${{ env.rerun-tests-timeout }}
242
+ max_attempts : ${{ env.rerun-tests-max-attempts }}
225
243
retry_on : any
226
244
command : |
227
245
. $CONDA/etc/profile.d/conda.sh
228
246
. $CONDA/etc/profile.d/mamba.sh
229
- mamba activate ${{ env.TEST_ENV_NAME }}
247
+ mamba activate ${{ env.test-env-name }}
230
248
231
249
python -m pytest -ra --pyargs dpnp.tests
232
250
env :
0 commit comments