1
1
name : Conda package
2
2
3
- on : push
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
4
8
5
9
env :
6
- PACKAGE_NAME : dpctl
10
+ PACKAGE_NAME : dpnp
11
+ MODULE_NAME : dpnp
12
+ VER_SCRIPT1 : " import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
13
+ VER_SCRIPT2 : " d = j['dpnp'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
7
14
8
15
jobs :
9
- build :
10
- runs-on : ubuntu-20.04
16
+ build_linux :
17
+ runs-on : ubuntu-latest
18
+
19
+ defaults :
20
+ run :
21
+ shell : bash -l {0}
11
22
12
23
strategy :
13
24
matrix :
14
- python : [3.8, 3.9]
25
+ python : ['3.8', '3.9']
26
+
27
+ env :
28
+ conda-pkgs : ' /home/runner/conda_pkgs_dir/'
29
+ conda-bld : ' /usr/share/miniconda3/envs/build/conda-bld/linux-64/'
15
30
16
31
steps :
17
- - name : Checkout repo
32
+ - name : Checkout DPNP repo
18
33
uses : actions/checkout@v3
19
34
with :
20
35
fetch-depth : 0
@@ -24,44 +39,165 @@ jobs:
24
39
with :
25
40
repository : oneapi-src/oneDPL
26
41
path : oneDPL
27
- ref : oneDPL-2021.6.1-release
42
+ ref : oneDPL-2021.7.0-release
43
+
44
+ - name : Setup miniconda
45
+ uses : conda-incubator/setup-miniconda@v2
46
+ with :
47
+ auto-update-conda : true
48
+ python-version : ${{ matrix.python }}
49
+ miniconda-version : ' latest'
50
+ activate-environment : ' build'
51
+ use-only-tar-bz2 : true
52
+
53
+ - name : Cache conda packages
54
+ uses : actions/cache@v3
55
+ env :
56
+ CACHE_NUMBER : 1 # Increase to reset cache
57
+ with :
58
+ path : ${{ env.conda-pkgs }}
59
+ key :
60
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
61
+ restore-keys : |
62
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
63
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
28
64
29
- - name : Add conda to system path
30
- run : echo $CONDA/bin >> $GITHUB_PATH
31
65
- name : Install conda-build
32
66
run : conda install conda-build
67
+
33
68
- name : Build conda package
34
69
run : ./scripts/build_conda_package.sh ${{ matrix.python }} $GITHUB_WORKSPACE/oneDPL
35
70
36
71
- name : Upload artifact
37
72
uses : actions/upload-artifact@v2
38
73
with :
39
- name : dpnp ${{ runner.os }} ${{ matrix.python }}
40
- path : /usr/share/miniconda/conda-bld/linux-64/dpnp-*.tar.bz2
74
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
75
+ path : ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
76
+
77
+ build_windows :
78
+ runs-on : windows-latest
79
+
80
+ defaults :
81
+ run :
82
+ shell : cmd /C CALL {0}
83
+
84
+ strategy :
85
+ matrix :
86
+ python : ['3.8', '3.9']
87
+
88
+ env :
89
+ conda-pkgs : ' C:\Users\runneradmin\conda_pkgs_dir\'
90
+ conda-bld : ' C:\Miniconda3\envs\build\conda-bld\win-64\'
91
+
92
+ steps :
93
+ - name : Checkout DPNP repo
94
+ uses : actions/checkout@v3
95
+ with :
96
+ fetch-depth : 0
97
+
98
+ - name : Checkout oneDPL
99
+ uses : actions/checkout@v3
100
+ with :
101
+ repository : oneapi-src/oneDPL
102
+ path : oneDPL
103
+ ref : oneDPL-2021.7.0-release
104
+
105
+ - name : Setup miniconda
106
+ uses : conda-incubator/setup-miniconda@v2
107
+ with :
108
+ auto-update-conda : true
109
+ python-version : ${{ matrix.python }}
110
+ miniconda-version : ' latest'
111
+ activate-environment : ' build'
112
+ use-only-tar-bz2 : true
113
+
114
+ - name : Cache conda packages
115
+ uses : actions/cache@v3
116
+ env :
117
+ CACHE_NUMBER : 1 # Increase to reset cache
118
+ with :
119
+ path : ${{ env.conda-pkgs }}
120
+ key :
121
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
122
+ restore-keys : |
123
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
124
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
125
+
126
+ - name : Install conda-build
127
+ run : conda install conda-build
128
+
129
+ - name : Build conda package
130
+ run : conda build --no-test --python ${{ matrix.python }} -c dppy/label/dev -c intel -c defaults --override-channels conda-recipe
131
+ env :
132
+ DPLROOT : ' %GITHUB_WORKSPACE%\oneDPL'
133
+
134
+ - name : Upload artifact
135
+ uses : actions/upload-artifact@v2
136
+ with :
137
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
138
+ path : ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
139
+
140
+ upload_linux :
141
+ needs : build_linux
142
+
143
+ if : ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
41
144
42
- upload :
43
- needs : build
44
- if : ${{ github.ref == 'refs/heads/master' }}
45
145
runs-on : ubuntu-latest
46
146
47
147
strategy :
48
148
matrix :
49
- python : [3.8, 3.9]
149
+ python : ['3.8', '3.9']
150
+
151
+ steps :
152
+ - name : Download artifact
153
+ uses : actions/download-artifact@v2
154
+ with :
155
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
50
156
157
+ - name : Setup miniconda
158
+ uses : conda-incubator/setup-miniconda@v2
159
+ with :
160
+ auto-update-conda : true
161
+ python-version : ${{ matrix.python }}
162
+ miniconda-version : ' latest'
163
+ activate-environment : ' upload'
164
+
165
+ - name : Install anaconda-client
166
+ run : conda install anaconda-client
167
+
168
+ - name : Upload
169
+ env :
170
+ ANACONDA_TOKEN : ${{ secrets.ANACONDA_TOKEN }}
171
+ run : anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2
172
+
173
+ upload_windows :
174
+ needs : build_windows
175
+
176
+ if : ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
177
+
178
+ runs-on : windows-latest
179
+
180
+ strategy :
181
+ matrix :
182
+ python : ['3.8', '3.9']
51
183
steps :
52
184
- name : Download artifact
53
185
uses : actions/download-artifact@v2
54
186
with :
55
- name : dpnp ${{ runner.os }} ${{ matrix.python }}
187
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
188
+
189
+ - name : Setup miniconda
190
+ uses : conda-incubator/setup-miniconda@v2
191
+ with :
192
+ auto-update-conda : true
193
+ python-version : ${{ matrix.python }}
194
+ miniconda-version : ' latest'
195
+ activate-environment : ' upload'
56
196
57
197
- name : Install anaconda-client
58
198
run : conda install anaconda-client
59
- - name : Add conda to system path
60
- run : echo $CONDA/bin >> $GITHUB_PATH
61
199
62
200
- name : Upload
63
201
env :
64
202
ANACONDA_TOKEN : ${{ secrets.ANACONDA_TOKEN }}
65
- run : |
66
- conda install anaconda-client
67
- anaconda --token $ANACONDA_TOKEN upload --user dppy --label dev dpnp-*.tar.bz2
203
+ run : anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2
0 commit comments