9
9
env :
10
10
PACKAGE_NAME : dpctl
11
11
MODULE_NAME : dpctl
12
+ VER_SCRIPT1 : " import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
13
+ VER_SCRIPT2 : " d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
12
14
13
15
jobs :
14
16
build_linux :
28
30
- name : Cache conda packages
29
31
uses : actions/cache@v2
30
32
env :
31
- CACHE_NUMBER : 0 # Increase to reset cache
33
+ CACHE_NUMBER : 1 # Increase to reset cache
32
34
with :
33
35
path : ~/.conda/pkgs
34
36
key :
76
78
- name : Cache conda packages
77
79
uses : actions/cache@v2
78
80
env :
79
- CACHE_NUMBER : 0 # Increase to reset cache
81
+ CACHE_NUMBER : 1 # Increase to reset cache
80
82
with :
81
83
path : /home/runner/conda_pkgs_dir
82
84
key :
@@ -124,21 +126,25 @@ jobs:
124
126
- name : Create conda channel
125
127
run : |
126
128
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
127
- mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64
128
- conda index $GITHUB_WORKSPACE/channel
129
+ conda index $GITHUB_WORKSPACE/channel || exit 1
130
+ mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64 || exit 1
131
+ conda index $GITHUB_WORKSPACE/channel || exit 1
129
132
# Test channel
130
- conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels
133
+ conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json
134
+ cat ver.json
131
135
- name : Collect dependencies
132
136
run : |
133
137
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
134
- conda install $PACKAGE_NAME python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
138
+ export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
139
+ conda install $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
140
+ cat lockfile
135
141
- name : Set pkgs_dirs
136
142
run : |
137
143
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
138
144
- name : Cache conda packages
139
145
uses : actions/cache@v2
140
146
env :
141
- CACHE_NUMBER : 0 # Increase to reset cache
147
+ CACHE_NUMBER : 1 # Increase to reset cache
142
148
with :
143
149
path : ~/.conda/pkgs
144
150
key :
@@ -149,7 +155,8 @@ jobs:
149
155
- name : Install dpctl
150
156
run : |
151
157
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
152
- conda install $PACKAGE_NAME pytest python=${{ matrix.python }} $CHANNELS
158
+ export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
159
+ conda install $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
153
160
# Test installed packages
154
161
conda list
155
162
- name : Smoke test
@@ -202,7 +209,7 @@ jobs:
202
209
- name : Cache conda packages
203
210
uses : actions/cache@v2
204
211
env :
205
- CACHE_NUMBER : 0 # Increase to reset cache
212
+ CACHE_NUMBER : 1 # Increase to reset cache
206
213
with :
207
214
path : /home/runner/conda_pkgs_dir
208
215
key :
@@ -355,7 +362,7 @@ jobs:
355
362
- name : Cache conda packages
356
363
uses : actions/cache@v2
357
364
env :
358
- CACHE_NUMBER : 0 # Increase to reset cache
365
+ CACHE_NUMBER : 1 # Increase to reset cache
359
366
with :
360
367
path : ~/.conda/pkgs
361
368
key :
0 commit comments