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">=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
28
22
29
23
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
+
30
59
test_by_tag :
31
60
name : Run tests with oneMKL tag
32
61
62
+ needs : build_env_file
63
+
33
64
strategy :
65
+ fail-fast : false
34
66
matrix :
35
67
python : ['3.13']
36
68
os : [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
37
69
38
- permissions :
39
- # Needed to cancel any previous runs that are not completed for a given workflow
40
- actions : write
41
-
42
70
runs-on : ${{ matrix.os }}
43
71
44
72
defaults :
45
73
run :
46
74
shell : ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
47
75
48
- continue-on-error : false
49
-
50
76
steps :
51
- - name : Cancel Previous Runs
52
- uses : styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
53
- with :
54
- access_token : ${{ github.token }}
55
-
56
77
- name : Checkout DPNP repo
57
78
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58
79
with :
59
80
fetch-depth : 0
60
81
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
+
61
88
- name : Setup miniconda
89
+ id : setup_miniconda
90
+ continue-on-error : true
62
91
uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
63
92
with :
64
93
miniforge-version : latest
65
94
use-mamba : ' true'
66
- channels : conda-forge
67
95
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 }}
74
98
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 }}
80
108
81
109
- name : Conda info
82
110
run : |
@@ -92,29 +120,25 @@ jobs:
92
120
python -m dpctl -f
93
121
python -c "import dpnp; print(dpnp.__version__)"
94
122
95
- - name : Install pytest
96
- run : |
97
- mamba install pytest ${{ env.CHANNELS }}
98
-
99
123
- name : Run tests
100
- if : env.RERUN_TESTS_ON_FAILURE != 'true'
124
+ if : env.rerun-tests-on-failure != 'true'
101
125
run : |
102
126
python -m pytest -ra --pyargs dpnp.tests
103
127
env :
104
128
SYCL_CACHE_PERSISTENT : 1
105
129
106
130
- name : ReRun tests on Linux
107
- if : env.RERUN_TESTS_ON_FAILURE == 'true'
131
+ if : env.rerun-tests-on-failure == 'true'
108
132
id : run_tests
109
133
uses : nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
110
134
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 }}
113
137
retry_on : any
114
138
command : |
115
139
. $CONDA/etc/profile.d/conda.sh
116
140
. $CONDA/etc/profile.d/mamba.sh
117
- mamba activate ${{ env.TEST_ENV_NAME }}
141
+ mamba activate ${{ env.test-env-name }}
118
142
119
143
python -m pytest -ra --pyargs dpnp.tests
120
144
env :
@@ -123,37 +147,35 @@ jobs:
123
147
test_by_branch :
124
148
name : Run tests with oneMKL develop branch
125
149
150
+ needs : build_env_file
151
+
126
152
strategy :
153
+ fail-fast : false
127
154
matrix :
128
155
python : ['3.13']
129
156
os : [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
130
157
131
- permissions :
132
- # Needed to cancel any previous runs that are not completed for a given workflow
133
- actions : write
134
-
135
158
runs-on : ${{ matrix.os }}
136
159
137
160
defaults :
138
161
run :
139
162
shell : ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
140
163
141
- continue-on-error : true
142
-
143
164
env :
144
165
onemkl-source-dir : ' ${{ github.workspace }}/onemkl/'
145
166
146
167
steps :
147
- - name : Cancel Previous Runs
148
- uses : styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
149
- with :
150
- access_token : ${{ github.token }}
151
-
152
168
- name : Checkout DPNP repo
153
169
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
154
170
with :
155
171
fetch-depth : 0
156
172
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
+
157
179
- name : Checkout oneMKL repo
158
180
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
159
181
with :
@@ -167,24 +189,25 @@ jobs:
167
189
ls -la ${{ env.onemkl-source-dir }}
168
190
169
191
- name : Setup miniconda
192
+ id : setup_miniconda
193
+ continue-on-error : true
170
194
uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
171
195
with :
172
196
miniforge-version : latest
173
197
use-mamba : ' true'
174
- channels : conda-forge
175
198
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 }}
178
201
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 }}
188
211
189
212
- name : Conda info
190
213
run : |
@@ -200,29 +223,25 @@ jobs:
200
223
python -m dpctl -f
201
224
python -c "import dpnp; print(dpnp.__version__)"
202
225
203
- - name : Install pytest
204
- run : |
205
- mamba install pytest ${{ env.CHANNELS }}
206
-
207
226
- name : Run tests
208
- if : env.RERUN_TESTS_ON_FAILURE ! = 'true'
227
+ if : env.rerun-tests-on-failure = = 'true'
209
228
run : |
210
229
python -m pytest -ra --pyargs dpnp.tests
211
230
env :
212
231
SYCL_CACHE_PERSISTENT : 1
213
232
214
233
- name : ReRun tests on Linux
215
- if : env.RERUN_TESTS_ON_FAILURE == 'true'
234
+ if : env.rerun-tests-on-failure == 'true'
216
235
id : run_tests
217
236
uses : nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
218
237
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 }}
221
240
retry_on : any
222
241
command : |
223
242
. $CONDA/etc/profile.d/conda.sh
224
243
. $CONDA/etc/profile.d/mamba.sh
225
- mamba activate ${{ env.TEST_ENV_NAME }}
244
+ mamba activate ${{ env.test-env-name }}
226
245
227
246
python -m pytest -ra --pyargs dpnp.tests
228
247
env :
0 commit comments