From 471d99ab6eaaf62276d1ab66999e72a3aa4943c8 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 10 Jan 2025 18:50:45 +0100 Subject: [PATCH] Resetup miniconda or reinstall conda-build on failure in Conda package GH action --- .github/workflows/conda-package.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 499de400c68..07d0cc264a0 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -56,6 +56,7 @@ jobs: fetch-depth: 0 - name: Setup miniconda + id: setup_miniconda uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 with: miniforge-version: latest @@ -65,9 +66,16 @@ jobs: python-version: ${{ env.CONDA_BUILD_INDEX_ENV_PY_VER}} activate-environment: 'build' - # Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba - - name: Disable speed limit check in mamba - run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV + - name: ReSetup miniconda + if: steps.setup_miniconda.outcome == 'failure' + uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 + with: + miniforge-version: latest + use-mamba: 'true' + channels: conda-forge + conda-remove-defaults: 'true' + python-version: ${{ matrix.python }} + activate-environment: ${{ env.TEST_ENV_NAME }} - name: Store conda paths as envs shell: bash -el {0} @@ -76,6 +84,11 @@ jobs: echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV - name: Install conda-build + id: install_conda_build + run: mamba install conda-build=${{ env.CONDA_BUILD_VERSION}} + + - name: ReInstall conda-build + if: steps.install_conda_build.outcome == 'failure' run: mamba install conda-build=${{ env.CONDA_BUILD_VERSION}} - name: Build conda package