Skip to content

Commit 66a78a8

Browse files
committed
Resetup miniconda or reinstall conda-build on failure in Conda package GH action
1 parent addd690 commit 66a78a8

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/conda-package.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656
fetch-depth: 0
5757

5858
- name: Setup miniconda
59+
id: setup_miniconda
60+
continue-on-error: true
5961
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
6062
with:
6163
miniforge-version: latest
@@ -65,9 +67,16 @@ jobs:
6567
python-version: ${{ env.CONDA_BUILD_INDEX_ENV_PY_VER}}
6668
activate-environment: 'build'
6769

68-
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
69-
- name: Disable speed limit check in mamba
70-
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
70+
- name: ReSetup miniconda
71+
if: steps.setup_miniconda.outcome == 'failure'
72+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
73+
with:
74+
miniforge-version: latest
75+
use-mamba: 'true'
76+
channels: conda-forge
77+
conda-remove-defaults: 'true'
78+
python-version: ${{ matrix.python }}
79+
activate-environment: ${{ env.TEST_ENV_NAME }}
7180

7281
- name: Store conda paths as envs
7382
shell: bash -el {0}
@@ -76,6 +85,12 @@ jobs:
7685
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV
7786
7887
- name: Install conda-build
88+
id: install_conda_build
89+
continue-on-error: true
90+
run: mamba install conda-build=${{ env.CONDA_BUILD_VERSION}}
91+
92+
- name: ReInstall conda-build
93+
if: steps.install_conda_build.outcome == 'failure'
7994
run: mamba install conda-build=${{ env.CONDA_BUILD_VERSION}}
8095

8196
- name: Build conda package

.github/workflows/cron-run-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979

8080
- name: Install dpnp
8181
id: install_dpnp
82+
continue-on-error: true
8283
run: |
8384
mamba install ${{ env.PACKAGE_NAME }}=${{ steps.find_latest_tag.outputs.tag }} pytest ${{ env.CHANNELS }}
8485

0 commit comments

Comments
 (0)