Skip to content

Commit 35295bf

Browse files
Use consistent order of channels during build and test phases
Bump up cache number Attempt to triage conda-package workflow source conda shell definition before calling calling activate test_examples_list must make sure to install the exact version built by build_linux step Require dpnp>=0.10.1
1 parent 8414053 commit 35295bf

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

.github/workflows/conda-package.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Cache conda packages
3131
uses: actions/cache@v3
3232
env:
33-
CACHE_NUMBER: 1 # Increase to reset cache
33+
CACHE_NUMBER: 3 # Increase to reset cache
3434
with:
3535
path: ~/.conda/pkgs
3636
key:
@@ -78,7 +78,7 @@ jobs:
7878
- name: Cache conda packages
7979
uses: actions/cache@v3
8080
env:
81-
CACHE_NUMBER: 1 # Increase to reset cache
81+
CACHE_NUMBER: 3 # Increase to reset cache
8282
with:
8383
path: /home/runner/conda_pkgs_dir
8484
key:
@@ -107,7 +107,7 @@ jobs:
107107
runner: [ubuntu-latest]
108108
continue-on-error: ${{ matrix.experimental }}
109109
env:
110-
CHANNELS: -c intel -c defaults --override-channels
110+
CHANNELS: -c defaults -c intel --override-channels
111111

112112
steps:
113113
- name: Download artifact
@@ -132,15 +132,15 @@ jobs:
132132
run: |
133133
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
134134
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
135-
conda install $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
135+
conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
136136
cat lockfile
137137
- name: Set pkgs_dirs
138138
run: |
139139
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
140140
- name: Cache conda packages
141141
uses: actions/cache@v3
142142
env:
143-
CACHE_NUMBER: 1 # Increase to reset cache
143+
CACHE_NUMBER: 3 # Increase to reset cache
144144
with:
145145
path: ~/.conda/pkgs
146146
key:
@@ -152,16 +152,20 @@ jobs:
152152
run: |
153153
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
154154
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
155-
conda install $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
155+
conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
156156
# Test installed packages
157157
conda list
158158
- name: Smoke test
159159
run: |
160+
. $CONDA/etc/profile.d/conda.sh
161+
conda activate test_dpctl
160162
export OCL_ICD_FILENAMES=libintelocl.so
161163
export SYCL_ENABLE_HOST_DEVICE=1
162164
python -c "import dpctl; dpctl.lsplatform()"
163165
- name: Run tests
164166
run: |
167+
. $CONDA/etc/profile.d/conda.sh
168+
conda activate test_dpctl
165169
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
166170
export OCL_ICD_FILENAMES=libintelocl.so
167171
export SYCL_ENABLE_HOST_DEVICE=1
@@ -179,7 +183,7 @@ jobs:
179183
runner: [windows-latest]
180184
continue-on-error: ${{ matrix.experimental }}
181185
env:
182-
CHANNELS: -c intel -c defaults --override-channels
186+
CHANNELS: -c defaults -c intel --override-channels
183187

184188
steps:
185189
- name: Download artifact
@@ -215,7 +219,7 @@ jobs:
215219
- name: Cache conda packages
216220
uses: actions/cache@v3
217221
env:
218-
CACHE_NUMBER: 1 # Increase to reset cache
222+
CACHE_NUMBER: 3 # Increase to reset cache
219223
with:
220224
path: /home/runner/conda_pkgs_dir
221225
key:
@@ -342,7 +346,7 @@ jobs:
342346
runner: [ubuntu-latest]
343347
continue-on-error: ${{ matrix.experimental }}
344348
env:
345-
CHANNELS: -c intel -c defaults --override-channels
349+
CHANNELS: -c defaults -c intel --override-channels
346350

347351
steps:
348352
- name: Install conda-build
@@ -361,10 +365,12 @@ jobs:
361365
- name: Create conda channel
362366
run: |
363367
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
364-
mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64
365-
conda index $GITHUB_WORKSPACE/channel
368+
conda index $GITHUB_WORKSPACE/channel || exit 1
369+
mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64 || exit 1
370+
conda index $GITHUB_WORKSPACE/channel || exit 1
366371
# Test channel
367-
conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels
372+
conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json
373+
cat ver.json
368374
- name: Collect dependencies
369375
run: |
370376
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
@@ -375,7 +381,7 @@ jobs:
375381
- name: Cache conda packages
376382
uses: actions/cache@v3
377383
env:
378-
CACHE_NUMBER: 1 # Increase to reset cache
384+
CACHE_NUMBER: 3 # Increase to reset cache
379385
with:
380386
path: ~/.conda/pkgs
381387
key:
@@ -387,7 +393,7 @@ jobs:
387393
shell: bash -l {0}
388394
run: |
389395
CHANNELS="${{ env.CHANNELS }}"
390-
source $CONDA/etc/profile.d/conda.sh
396+
. $CONDA/etc/profile.d/conda.sh
391397
conda create -n examples -y pytest python=${{ matrix.python }} $CHANNELS
392398
conda install -n examples -y cmake">=3.22" $CHANNELS || exit 1
393399
conda install -n examples -y ninja $CHANNELS || exit 1
@@ -398,9 +404,9 @@ jobs:
398404
shell: bash -l {0}
399405
run: |
400406
source $CONDA/etc/profile.d/conda.sh
401-
conda activate
402-
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel --override-channels"
403-
conda install -n examples -y $CHANNELS numpy dpctl dpnp || exit 1
407+
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c defaults --override-channels"
408+
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
409+
conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1
404410
- name: Build and run examples with native extensions
405411
shell: bash -l {0}
406412
run: |

0 commit comments

Comments
 (0)