12
12
PACKAGE_NAME : dpctl
13
13
MODULE_NAME : dpctl
14
14
TEST_ENV_NAME : test_dpctl
15
- VER_SCRIPT1 : " import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
16
- VER_SCRIPT2 : " d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
15
+ VER_SCRIPT1 : " import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); d = j['dpctl'][0];"
16
+ VER_SCRIPT2 : " print('='.join((d[s] for s in ('version', 'build'))))"
17
+ VER_SCRIPT3 : " print(' '.join(map(lambda s: chr(34) + s + chr(34), [comp for comp in d['depends'] if 'dpcpp' in comp][1:])))"
17
18
INTEL_CHANNEL : " https://software.repos.intel.com/python/conda/"
18
19
19
20
jobs :
20
21
build_linux :
21
22
runs-on : ubuntu-22.04
23
+ timeout-minutes : 90
22
24
23
25
strategy :
24
26
matrix :
25
27
python : ['3.9', '3.10', '3.11', '3.12']
26
28
steps :
27
- - uses : actions/checkout@v4.1.7
29
+ - uses : actions/checkout@v4.2.2
28
30
with :
29
31
fetch-depth : 0
30
32
@@ -62,35 +64,43 @@ jobs:
62
64
$CHANNELS \
63
65
conda-recipe
64
66
- name : Upload artifact
65
- uses : actions/upload-artifact@v4.4.0
67
+ uses : actions/upload-artifact@v4.4.3
66
68
with :
67
69
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
68
70
path : /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
69
71
- name : Upload wheels artifact
70
- uses : actions/upload-artifact@v4.4.0
72
+ uses : actions/upload-artifact@v4.4.3
71
73
with :
72
74
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
73
75
path : ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl
74
76
75
77
build_windows :
76
78
runs-on : windows-2019
79
+ timeout-minutes : 150
77
80
78
81
strategy :
79
82
matrix :
80
83
python : ['3.9', '3.10', '3.11', '3.12']
81
- env :
82
- conda-bld : C:\Miniconda\conda-bld\win-64\
83
84
steps :
84
- - uses : actions/checkout@v4.1.7
85
+ - uses : actions/checkout@v4.2.2
85
86
with :
86
87
fetch-depth : 0
88
+
87
89
- uses : conda-incubator/setup-miniconda@v3
88
90
with :
89
- auto-activate-base : true
90
- conda-build-version : " *"
91
- activate-environment : true
91
+ miniforge-variant : Miniforge3
92
+ miniforge-version : latest
93
+ activate-environment : build
94
+ channels : conda-forge
95
+ conda-remove-defaults : true
92
96
python-version : ${{ matrix.python }}
93
97
98
+ - name : Install conda build
99
+ run : |
100
+ conda activate
101
+ conda install -y conda-build
102
+ conda list -n base
103
+
94
104
- name : Cache conda packages
95
105
uses : actions/cache@v4
96
106
env :
@@ -102,28 +112,36 @@ jobs:
102
112
restore-keys : |
103
113
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
104
114
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
115
+
105
116
- name : Store conda paths as envs
106
117
shell : bash -l {0}
107
118
run : |
119
+ echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
108
120
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV
121
+
109
122
- name : Build conda package
110
123
env :
111
124
OVERRIDE_INTEL_IPO : 1 # IPO requires more resources that GH actions VM provides
112
- run : conda build --no-test --python ${{ matrix.python }} --numpy 2.0 -c conda-forge --override-channels conda-recipe
125
+ run : |
126
+ conda activate
127
+ conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe
128
+
113
129
- name : Upload artifact
114
- uses : actions/upload-artifact@v4.4.0
130
+ uses : actions/upload-artifact@v4.4.3
115
131
with :
116
132
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
117
- path : ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
133
+ path : ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
134
+
118
135
- name : Upload wheels artifact
119
- uses : actions/upload-artifact@v4.4.0
136
+ uses : actions/upload-artifact@v4.4.3
120
137
with :
121
138
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
122
139
path : ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl
123
140
124
141
test_linux :
125
142
needs : build_linux
126
143
runs-on : ${{ matrix.runner }}
144
+ timeout-minutes : 30
127
145
128
146
strategy :
129
147
matrix :
@@ -215,6 +233,7 @@ jobs:
215
233
test_windows :
216
234
needs : build_windows
217
235
runs-on : ${{ matrix.runner }}
236
+ timeout-minutes : 60
218
237
defaults :
219
238
run :
220
239
shell : cmd /C CALL {0}
@@ -232,38 +251,61 @@ jobs:
232
251
shell : pwsh
233
252
run : |
234
253
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $env:GITHUB_ENV
254
+
235
255
- name : Display channels line
236
256
run : |
237
257
echo ${{ env.CHANNELS }}
258
+
238
259
- name : Download artifact
239
260
uses : actions/download-artifact@v4
240
261
with :
241
262
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
263
+
242
264
- uses : conda-incubator/setup-miniconda@v3
243
265
with :
244
- auto-update-conda : true
245
- conda-build-version : ' * '
246
- miniconda-version : ' latest '
266
+ miniforge-version : latest
267
+ channels : conda-forge
268
+ conda-remove-defaults : true
247
269
activate-environment : ${{ env.TEST_ENV_NAME }}
248
270
python-version : ${{ matrix.python }}
271
+
272
+ - name : Install conda-index
273
+ run : |
274
+ conda install -n base conda-index
275
+
249
276
- name : Create conda channel with the artifact bit
250
277
shell : cmd /C CALL {0}
251
278
run : |
279
+ @echo on
252
280
echo ${{ env.workdir }}
281
+ mkdir ${{ env.workdir }}\channel
253
282
mkdir ${{ env.workdir }}\channel\win-64
254
283
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
255
- dir ${{ env.workdir }}\channel\win-64
284
+ dir ${{ env.workdir }}\channel\win-64\
285
+
256
286
- name : Index the channel
257
287
shell : cmd /C CALL {0}
258
- run : conda index ${{ env.workdir }}\channel
288
+ run : |
289
+ @echo on
290
+ conda index ${{ env.workdir }}\channel
291
+
292
+ - name : List content of the channels
293
+ shell : cmd /C CALL {0}
294
+ run : |
295
+ dir ${{ env.workdir }}\channel
296
+ dir ${{ env.workdir }}\channel\win-64
259
297
260
298
- name : Dump dpctl version info from created channel into ver.json
261
299
shell : cmd /C CALL {0}
262
300
run : |
301
+ @echo on
263
302
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
303
+ dir ${{ env.workdir }}
304
+
264
305
- name : Output content of produced ver.json
265
306
shell : pwsh
266
307
run : Get-Content -Path ${{ env.workdir }}\ver.json
308
+
267
309
- name : Collect dependencies
268
310
shell : cmd /C CALL {0}
269
311
run : |
@@ -275,9 +317,11 @@ jobs:
275
317
SET PACKAGE_VERSION=%%F
276
318
)
277
319
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
320
+
278
321
- name : Display lockfile content
279
322
shell : pwsh
280
323
run : Get-Content -Path .\lockfile
324
+
281
325
- name : Cache conda packages
282
326
uses : actions/cache@v4
283
327
env :
@@ -289,9 +333,11 @@ jobs:
289
333
restore-keys : |
290
334
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
291
335
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
336
+
292
337
- name : Install opencl_rt
293
338
shell : cmd /C CALL {0}
294
339
run : conda install -n ${{ env.TEST_ENV_NAME }} opencl_rt -c ${{ env.INTEL_CHANNEL }} --override-channels
340
+
295
341
- name : Install dpctl
296
342
shell : cmd /C CALL {0}
297
343
run : |
@@ -305,37 +351,48 @@ jobs:
305
351
)
306
352
SET TEST_DEPENDENCIES=pytest"<8" pytest-cov cython setuptools
307
353
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
354
+
308
355
- name : Report content of test environment
309
356
shell : cmd /C CALL {0}
310
357
run : |
311
358
echo "Value of CONDA enviroment variable was: " %CONDA%
312
359
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
313
360
conda info && conda list -n ${{ env.TEST_ENV_NAME }}
361
+
314
362
- name : Configure Intel OpenCL CPU RT
315
363
shell : pwsh
316
364
run : |
317
365
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
318
- &$script_path
366
+ if (Test-Path $script_path) {
367
+ &$script_path
368
+ } else {
369
+ Write-Warning "File $script_path was NOT found!"
370
+ }
319
371
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
320
372
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
321
373
Get-Content -Tail 5 -Path $cl_cfg
374
+
322
375
- name : Smoke test, step 1
323
376
shell : cmd /C CALL {0}
324
377
run : >-
325
378
conda activate ${{ env.TEST_ENV_NAME }} && python -c "import sys; print(sys.executable)"
379
+
326
380
- name : Smoke test, step 2
327
381
shell : cmd /C CALL {0}
328
382
run : >-
329
383
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
384
+
330
385
- name : Create empty temporary directory to run tests from
331
386
shell : cmd /C CALL {0}
332
387
# create temporary empty folder to runs tests from
333
388
# https://github.com/pytest-dev/pytest/issues/11904
334
389
run : >-
335
390
mkdir "${{ env.workdir }}\test_tmp"
391
+
336
392
- name : List content of workdir folder
337
393
shell : cmd /C CALL {0}
338
394
run : dir "${{ env.workdir }}"
395
+
339
396
- name : Run tests
340
397
shell : cmd /C CALL {0}
341
398
env :
@@ -348,6 +405,7 @@ jobs:
348
405
needs : test_linux
349
406
if : ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
350
407
runs-on : ubuntu-22.04
408
+ timeout-minutes : 20
351
409
strategy :
352
410
matrix :
353
411
python : ['3.9', '3.10', '3.11', '3.12']
@@ -384,6 +442,7 @@ jobs:
384
442
needs : test_windows
385
443
if : ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
386
444
runs-on : windows-2019
445
+ timeout-minutes : 20
387
446
strategy :
388
447
matrix :
389
448
python : ['3.9', '3.10', '3.11', '3.12']
@@ -400,6 +459,9 @@ jobs:
400
459
401
460
- uses : conda-incubator/setup-miniconda@v3
402
461
with :
462
+ miniforge-version : latest
463
+ channels : conda-forge
464
+ conda-remove-defaults : true
403
465
auto-activate-base : true
404
466
activate-environment : " "
405
467
@@ -430,6 +492,7 @@ jobs:
430
492
experimental : [false]
431
493
runner : [ubuntu-22.04]
432
494
continue-on-error : ${{ matrix.experimental }}
495
+ timeout-minutes : 60
433
496
env :
434
497
EXAMPLES_ENV_NAME : examples
435
498
BUILD_ENV_NAME : build_env
@@ -445,7 +508,7 @@ jobs:
445
508
# Needed to be able to run conda index
446
509
run : conda install conda-index -c conda-forge --override-channels
447
510
- name : Checkout dpctl repo
448
- uses : actions/checkout@v4.1.7
511
+ uses : actions/checkout@v4.2.2
449
512
with :
450
513
fetch-depth : 0
451
514
- name : Download artifact
@@ -484,18 +547,28 @@ jobs:
484
547
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
485
548
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
486
549
- name : Install example requirements
487
- shell : bash -l {0}
550
+ shell : bash -ex - l {0}
488
551
env :
489
- DPCPP_CMPLR : dpcpp_linux-64" >=2024.2"
552
+ DPCPP_CMPLR : " dpcpp_linux-64>=2024.2"
490
553
run : |
491
554
CHANNELS="${{ env.CHANNELS }}"
492
555
. $CONDA/etc/profile.d/conda.sh
493
- conda create -n ${{ env.EXAMPLES_ENV_NAME }} -y pytest python=${{ matrix.python }} setuptools"<72.2.0" $CHANNELS
494
- conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y cmake $CHANNELS || exit 1
495
- conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y ninja $CHANNELS || exit 1
556
+ DPCTL_DEPENDS="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT3}")"
557
+ echo "Dpctl dependencies: ${DPCTL_DEPENDS}"
558
+ conda create -n ${{ env.EXAMPLES_ENV_NAME }} -y pytest python=${{ matrix.python }} "setuptools<72.2.0" $CHANNELS
559
+ echo "Environment created"
560
+ conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y cmake ninja $CHANNELS || exit 1
561
+ echo "Cmake and Ninja installed"
496
562
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y pybind11 cython scikit-build $CHANNELS || exit 1
497
- conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y mkl-dpcpp mkl-devel-dpcpp dpcpp_cpp_rt $CHANNELS || exit 1
498
- conda create -y -n ${{ env.BUILD_ENV_NAME }} $CHANNELS gcc_linux-64 gxx_linux-64 ${{ env.DPCPP_CMPLR }} sysroot_linux-64">=2.28"
563
+ echo "scikit-build installed"
564
+ conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y mkl-dpcpp \
565
+ mkl-devel-dpcpp dpcpp_cpp_rt "${DPCTL_DEPENDS}" \
566
+ $CHANNELS || exit 1
567
+ echo "IPL installed"
568
+ conda create -y -n ${{ env.BUILD_ENV_NAME }} $CHANNELS gcc_linux-64 gxx_linux-64 \
569
+ ${{ env.DPCPP_CMPLR }} "${DPCTL_DEPENDS}" \
570
+ "sysroot_linux-64>=2.28"
571
+ echo "Compiler installed"
499
572
- name : Install dpctl
500
573
shell : bash -l {0}
501
574
run : |
@@ -577,6 +650,7 @@ jobs:
577
650
array-api-conformity :
578
651
needs : build_linux
579
652
runs-on : ${{ matrix.runner }}
653
+ timeout-minutes : 90
580
654
permissions :
581
655
pull-requests : write
582
656
@@ -594,7 +668,7 @@ jobs:
594
668
run : |
595
669
echo ${{ env.CHANNELS }}
596
670
- name : Checkout dpctl repo
597
- uses : actions/checkout@v4.1.7
671
+ uses : actions/checkout@v4.2.2
598
672
with :
599
673
fetch-depth : 0
600
674
- name : Cache array API tests
@@ -722,6 +796,7 @@ jobs:
722
796
name : Clean up anaconda packages
723
797
needs : [upload_linux, upload_windows]
724
798
runs-on : ' ubuntu-latest'
799
+ timeout-minutes : 30
725
800
defaults :
726
801
run :
727
802
shell : bash -el {0}
@@ -731,13 +806,14 @@ jobs:
731
806
run-post : false
732
807
channel-priority : " disabled"
733
808
channels : conda-forge
809
+ conda-remove-defaults : true
734
810
python-version : ' 3.11'
735
811
736
812
- name : Install anaconda-client
737
813
run : conda install anaconda-client -c conda-forge --override-channels
738
814
739
815
- name : Checkout repo
740
- uses : actions/checkout@v4.1.7
816
+ uses : actions/checkout@v4.2.2
741
817
with :
742
818
repository : IntelPython/devops-tools
743
819
fetch-depth : 0
0 commit comments