7
7
MODULE_NAME : dpctl
8
8
9
9
jobs :
10
- build :
11
- runs-on : ${{ matrix.os }}
10
+ build_linux :
11
+ runs-on : ubuntu-latest
12
+
13
+ strategy :
14
+ matrix :
15
+ python : [3.8]
16
+ steps :
17
+ - uses : actions/checkout@v2
18
+ with :
19
+ fetch-depth : 0
20
+
21
+ - name : Set pkgs_dirs
22
+ run : |
23
+ echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
24
+ - name : Cache conda packages
25
+ uses : actions/cache@v2
26
+ env :
27
+ CACHE_NUMBER : 0 # Increase to reset cache
28
+ with :
29
+ path : ~/.conda/pkgs
30
+ key :
31
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
32
+ restore-keys : |
33
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
34
+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
35
+ - name : Add conda to system path
36
+ run : echo $CONDA/bin >> $GITHUB_PATH
37
+ - name : Install conda-build
38
+ run : conda install conda-build
39
+ - name : Build conda package
40
+ run : |
41
+ CHANNELS="-c intel -c defaults --override-channels"
42
+ VERSIONS="--python ${{ matrix.python }}"
43
+ TEST="--no-test"
44
+ conda build \
45
+ $TEST \
46
+ $VERSIONS \
47
+ $CHANNELS \
48
+ conda-recipe
49
+ - name : Upload artifact
50
+ uses : actions/upload-artifact@v2
51
+ with :
52
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
53
+ path : /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
54
+
55
+ build_windows :
56
+ runs-on : windows-latest
57
+
12
58
strategy :
13
59
matrix :
14
- os : [ubuntu-latest, windows-latest]
15
- include :
16
- - os : ubuntu-latest
17
- pkgs_dirs : ~/.conda/pkgs
18
- condarc : ~/.condarc
19
- conda-bld : /usr/share/miniconda/conda-bld/linux-64/
20
- - os : windows-latest
21
- pkgs_dirs : C:\Users\runneradmin\.conda\pkgs
22
- condarc : C:\Users\runneradmin\.condarc
23
- conda-bld : C:\Miniconda\conda-bld\win-64\
24
60
python : [3.8]
61
+ env :
62
+ conda-bld : C:\Miniconda\conda-bld\win-64\
25
63
steps :
26
64
- uses : actions/checkout@v2
27
65
with :
@@ -31,15 +69,12 @@ jobs:
31
69
auto-activate-base : true
32
70
activate-environment : " "
33
71
34
- - name : Set pkgs_dirs
35
- run : |
36
- echo "pkgs_dirs: [${{ matrix.pkgs_dirs }}]" >> ${{ matrix.condarc }}
37
72
- name : Cache conda packages
38
73
uses : actions/cache@v2
39
74
env :
40
75
CACHE_NUMBER : 0 # Increase to reset cache
41
76
with :
42
- path : ${{ matrix.pkgs_dirs }}
77
+ path : /home/runner/conda_pkgs_dir
43
78
key :
44
79
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
45
80
restore-keys : |
@@ -53,10 +88,10 @@ jobs:
53
88
uses : actions/upload-artifact@v2
54
89
with :
55
90
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
56
- path : ${{ matrix .conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
91
+ path : ${{ env .conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
57
92
58
93
test_linux :
59
- needs : build
94
+ needs : build_linux
60
95
runs-on : ${{ matrix.runner }}
61
96
62
97
strategy :
@@ -120,7 +155,7 @@ jobs:
120
155
python -m pytest --pyargs $MODULE_NAME
121
156
122
157
test_windows :
123
- needs : build
158
+ needs : build_windows
124
159
runs-on : ${{ matrix.runner }}
125
160
126
161
strategy :
@@ -152,15 +187,12 @@ jobs:
152
187
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.GITHUB_WORKSPACE }}/channel --override-channels
153
188
- name : Collect dependencies
154
189
run : conda install ${{ env.PACKAGE_NAME }} python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
155
- - name : Set pkgs_dirs
156
- run : |
157
- echo "pkgs_dirs: [C:\Users\runneradmin\.conda\pkgs]" >> C:\Users\runneradmin\.condarc
158
190
- name : Cache conda packages
159
191
uses : actions/cache@v2
160
192
env :
161
193
CACHE_NUMBER : 0 # Increase to reset cache
162
194
with :
163
- path : C:\Users\runneradmin\.conda\pkgs
195
+ path : /home/runner/conda_pkgs_dir
164
196
key :
165
197
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
166
198
restore-keys : |
0 commit comments