Skip to content

Commit 30e26b5

Browse files
committed
Add checkchannel where package is installed
test test test test test test test test test test test
1 parent 1314c9e commit 30e26b5

File tree

3 files changed

+60
-10
lines changed

3 files changed

+60
-10
lines changed

.github/workflows/build_conda_linux.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,31 @@ jobs:
180180
CONSTRAINTS="cpuonly"
181181
fi
182182
183+
# From Conda documnetation:
184+
# https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html#specifying-channels-when-installing-packages
185+
# From the command line use --c
186+
# You may specify multiple channels by passing the argument multiple times.
187+
# Priority decreases from left to right - the first argument is higher priority than the second.
188+
# From the command line use --override-channels to only search the specified channel(s),
189+
# rather than any channels configured in .condarc.
190+
183191
${CONDA_RUN_SMOKE} conda install \
184192
--yes \
185193
--quiet \
194+
-c "${CONDA_LOCAL_CHANNEL}" \
186195
-c pytorch-"${CHANNEL}" \
187196
-c nvidia \
188-
-c "${CONDA_LOCAL_CHANNEL}" \
189-
distr::"${PACKAGE_NAME}" \
190-
${CONSTRAINTS}
197+
-c defaults \
198+
"${PACKAGE_NAME}" \
199+
${CONSTRAINTS} \
200+
--override-channels
201+
202+
# check for installed package channel
203+
if [[ -z "$(${CONDA_RUN_SMOKE} conda list | grep ${PACKAGE_NAME} | grep ${CONDA_LOCAL_CHANNEL})" ]]; then
204+
echo "${PACKAGE_NAME} is not installed from local channel"
205+
${CONDA_RUN_SMOKE} conda list
206+
exit 1
207+
fi
191208
192209
if [[ ! -f "${{ inputs.repository }}"/${SMOKE_TEST_SCRIPT} ]]; then
193210
echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} not found"

.github/workflows/build_conda_macos.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,31 @@ jobs:
182182
export CONDA_RUN_SMOKE="conda run -p ${CONDA_ENV_SMOKE}"
183183
export OLD_PATH=${PATH}
184184
export PATH="${CONDA_ENV_SMOKE}/bin:${PATH}"
185-
186185
CONDA_LOCAL_CHANNEL="file://$(readlink -f ${{ inputs.repository }}/distr)"
186+
187+
# From Conda documnetation:
188+
# https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html#specifying-channels-when-installing-packages
189+
# From the command line use --c
190+
# You may specify multiple channels by passing the argument multiple times.
191+
# Priority decreases from left to right - the first argument is higher priority than the second.
192+
# From the command line use --override-channels to only search the specified channel(s),
193+
# rather than any channels configured in .condarc.
194+
187195
${CONDA_RUN_SMOKE} conda install \
188196
--quiet \
189197
--yes \
190-
-c pytorch-${CHANNEL} \
191198
-c "${CONDA_LOCAL_CHANNEL}" \
192-
"distr::"${PACKAGE_NAME}"" \
193-
"-—solver=classic"
199+
-c pytorch-${CHANNEL} \
200+
-c defaults \
201+
"${PACKAGE_NAME}" \
202+
"--override-channels"
203+
204+
# check for installed package channel
205+
if [[ -z "$(${CONDA_RUN_SMOKE} conda list | grep ${PACKAGE_NAME} | grep ${CONDA_LOCAL_CHANNEL})" ]]; then
206+
echo "${PACKAGE_NAME} is not installed from local channel"
207+
${CONDA_RUN_SMOKE} conda list
208+
exit 1
209+
fi
194210
195211
if [[ ! -f "${{ inputs.repository }}"/${SMOKE_TEST_SCRIPT} ]]; then
196212
echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} not found"

.github/workflows/build_conda_windows.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,31 @@ jobs:
200200
CONSTRAINTS="cpuonly"
201201
fi
202202
203+
# From Conda documnetation:
204+
# https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html#specifying-channels-when-installing-packages
205+
# From the command line use --c
206+
# You may specify multiple channels by passing the argument multiple times.
207+
# Priority decreases from left to right - the first argument is higher priority than the second.
208+
# From the command line use --override-channels to only search the specified channel(s),
209+
# rather than any channels configured in .condarc.
210+
203211
${CONDA_RUN_SMOKE} conda install \
204212
--quiet \
205213
--yes \
214+
-c "${CONDA_LOCAL_CHANNEL}" \
206215
-c pytorch-"${CHANNEL}" \
207216
-c nvidia \
208-
-c "${CONDA_LOCAL_CHANNEL}" \
209-
distr::"${PACKAGE_NAME}" \
210-
${CONSTRAINTS}
217+
-c defaults \
218+
"${PACKAGE_NAME}" \
219+
${CONSTRAINTS} \
220+
--override-channels
221+
222+
# check for installed package channel
223+
if [[ -z "$(${CONDA_RUN_SMOKE} conda list | grep ${PACKAGE_NAME} | grep ${CONDA_LOCAL_CHANNEL})" ]]; then
224+
echo "${PACKAGE_NAME} is not installed from local channel"
225+
${CONDA_RUN_SMOKE} conda list
226+
exit 1
227+
fi
211228
212229
if [[ ! -f "${{ inputs.repository }}"/${SMOKE_TEST_SCRIPT} ]]; then
213230
echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} not found"

0 commit comments

Comments
 (0)