99env :
1010 PACKAGE_NAME : dpctl
1111 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'))))"
1214
1315jobs :
1416 build_linux :
2830 - name : Cache conda packages
2931 uses : actions/cache@v2
3032 env :
31- CACHE_NUMBER : 0 # Increase to reset cache
33+ CACHE_NUMBER : 1 # Increase to reset cache
3234 with :
3335 path : ~/.conda/pkgs
3436 key :
7678 - name : Cache conda packages
7779 uses : actions/cache@v2
7880 env :
79- CACHE_NUMBER : 0 # Increase to reset cache
81+ CACHE_NUMBER : 1 # Increase to reset cache
8082 with :
8183 path : /home/runner/conda_pkgs_dir
8284 key :
@@ -124,21 +126,25 @@ jobs:
124126 - name : Create conda channel
125127 run : |
126128 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
129132 # 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
131135 - name : Collect dependencies
132136 run : |
133137 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
135141 - name : Set pkgs_dirs
136142 run : |
137143 echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
138144 - name : Cache conda packages
139145 uses : actions/cache@v2
140146 env :
141- CACHE_NUMBER : 0 # Increase to reset cache
147+ CACHE_NUMBER : 1 # Increase to reset cache
142148 with :
143149 path : ~/.conda/pkgs
144150 key :
@@ -149,7 +155,8 @@ jobs:
149155 - name : Install dpctl
150156 run : |
151157 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
153160 # Test installed packages
154161 conda list
155162 - name : Smoke test
@@ -202,7 +209,7 @@ jobs:
202209 - name : Cache conda packages
203210 uses : actions/cache@v2
204211 env :
205- CACHE_NUMBER : 0 # Increase to reset cache
212+ CACHE_NUMBER : 1 # Increase to reset cache
206213 with :
207214 path : /home/runner/conda_pkgs_dir
208215 key :
@@ -355,7 +362,7 @@ jobs:
355362 - name : Cache conda packages
356363 uses : actions/cache@v2
357364 env :
358- CACHE_NUMBER : 0 # Increase to reset cache
365+ CACHE_NUMBER : 1 # Increase to reset cache
359366 with :
360367 path : ~/.conda/pkgs
361368 key :
0 commit comments