24
24
VER_SCRIPT2 : " d = j['dpnp'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
25
25
26
26
jobs :
27
- build_linux :
28
- runs-on : ubuntu-latest
29
-
30
- defaults :
31
- run :
32
- shell : bash -l {0}
27
+ build :
28
+ name : Build ['${{ matrix.os }}', python='${{ matrix.python }}']
33
29
34
30
strategy :
35
31
matrix :
36
32
python : ['3.8', '3.9']
33
+ os : [ubuntu-latest, windows-latest]
34
+ include :
35
+ - python : ' 3.10'
36
+ os : ubuntu-latest
37
37
38
- env :
39
- conda-pkgs : ' /home/runner/conda_pkgs_dir/'
40
-
41
- steps :
42
- - name : Cancel Previous Runs
43
-
44
- with :
45
- access_token : ${{ github.token }}
46
-
47
- - name : Checkout DPNP repo
48
-
49
- with :
50
- fetch-depth : 0
51
-
52
- - name : Setup miniconda
53
- uses :
conda-incubator/[email protected]
54
- with :
55
- auto-update-conda : true
56
- python-version : ${{ matrix.python }}
57
- miniconda-version : ' latest'
58
- activate-environment : ' build'
59
- use-only-tar-bz2 : true
60
-
61
- - name : Store conda paths as envs
62
- run : echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/linux-64/" >> $GITHUB_ENV
63
-
64
- - name : Install conda-build
65
- run : conda install conda-build
66
-
67
- - name : Cache conda packages
68
-
69
- env :
70
- CACHE_NUMBER : 1 # Increase to reset cache
71
- with :
72
- path : ${{ env.conda-pkgs }}
73
- key :
74
- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
75
- restore-keys : |
76
- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
77
- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
78
-
79
- - name : Build conda package
80
- run : conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe
81
-
82
- - name : Upload artifact
83
-
84
- with :
85
- name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
86
- path : ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
87
-
88
- build_windows :
89
- runs-on : windows-latest
38
+ runs-on : ${{ matrix.os }}
90
39
91
40
defaults :
92
41
run :
93
- shell : cmd /C CALL {0}
42
+ shell : ${{ matrix.os == 'windows-latest' && ' cmd /C CALL {0}' || 'bash -l {0}' } }
94
43
95
- strategy :
96
- matrix :
97
- python : ['3.8', '3.9']
98
-
99
- env :
100
- conda-pkgs : ' C:\Users\runneradmin\conda_pkgs_dir\'
44
+ continue-on-error : false
101
45
102
46
steps :
103
47
- name : Cancel Previous Runs
@@ -119,26 +63,31 @@ jobs:
119
63
activate-environment : ' build'
120
64
use-only-tar-bz2 : true
121
65
122
- - name : Store conda paths as envs
66
+ - if : matrix.os == 'ubuntu-latest'
67
+ name : Store conda paths as envs on Linux
68
+ run : echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/linux-64/" >> $GITHUB_ENV
69
+
70
+ - if : matrix.os == 'windows-latest'
71
+ name : Store conda paths as envs on Win
123
72
run : |
124
73
@echo on
125
74
(echo CONDA_BLD=%CONDA_PREFIX%\conda-bld\win-64\) >> %GITHUB_ENV%
126
75
76
+ - name : Install conda-build
77
+ run : conda install conda-build
78
+
127
79
- name : Cache conda packages
128
80
129
81
env :
130
82
CACHE_NUMBER : 1 # Increase to reset cache
131
83
with :
132
- path : ${{ env.conda-pkgs }}
84
+ path : ${{ env.CONDA_PKGS_DIR }}
133
85
key :
134
86
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
135
87
restore-keys : |
136
88
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
137
89
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
138
90
139
- - name : Install conda-build
140
- run : conda install conda-build
141
-
142
91
- name : Build conda package
143
92
run : conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe
144
93
149
98
path : ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
150
99
151
100
test_linux :
152
- needs : build_linux
101
+ name : Test ['ubuntu-latest', python='${{ matrix.python }}']
102
+
103
+ needs : build
153
104
154
105
runs-on : ubuntu-latest
155
106
@@ -250,7 +201,9 @@ jobs:
250
201
working-directory : ${{ env.tests-path }}
251
202
252
203
test_windows :
253
- needs : build_windows
204
+ name : Test ['windows-latest', python='${{ matrix.python }}']
205
+
206
+ needs : build
254
207
255
208
runs-on : windows-latest
256
209
@@ -422,61 +375,28 @@ jobs:
422
375
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
423
376
working-directory : ${{ env.tests-path }}
424
377
425
- upload_linux :
426
- needs : test_linux
427
-
428
- if : |
429
- (github.repository == 'IntelPython/dpnp') &&
430
- (github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
431
-
432
- runs-on : ubuntu-latest
378
+ upload :
379
+ name : Upload ['${{ matrix.os }}', python='${{ matrix.python }}']
433
380
434
- defaults :
435
- run :
436
- shell : bash -l {0}
381
+ needs : [test_linux, test_windows]
437
382
438
383
strategy :
439
384
matrix :
440
385
python : ['3.8', '3.9']
386
+ os : [ubuntu-latest, windows-latest]
441
387
442
- steps :
443
- - name : Download artifact
444
-
445
- with :
446
- name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
447
-
448
- - name : Setup miniconda
449
- uses :
conda-incubator/[email protected]
450
- with :
451
- auto-update-conda : true
452
- python-version : ${{ matrix.python }}
453
- miniconda-version : ' latest'
454
- activate-environment : ' upload'
388
+ runs-on : ${{ matrix.os }}
455
389
456
- - name : Install anaconda-client
457
- run : conda install anaconda-client
458
-
459
- - name : Upload
460
- run : anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2
461
- env :
462
- ANACONDA_TOKEN : ${{ secrets.ANACONDA_TOKEN }}
390
+ defaults :
391
+ run :
392
+ shell : ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -l {0}' }}
463
393
464
- upload_windows :
465
- needs : test_windows
394
+ continue-on-error : false
466
395
467
396
if : |
468
397
(github.repository == 'IntelPython/dpnp') &&
469
398
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
470
399
471
- runs-on : windows-latest
472
-
473
- defaults :
474
- run :
475
- shell : cmd /C CALL {0}
476
-
477
- strategy :
478
- matrix :
479
- python : ['3.8', '3.9']
480
400
steps :
481
401
- name : Download artifact
482
402
0 commit comments