Skip to content

Commit

Permalink
Resetup miniconda or reinstall conda-build on failure in Conda packag…
Browse files Browse the repository at this point in the history
…e GH action
  • Loading branch information
antonwolfy committed Jan 10, 2025
1 parent addd690 commit 471d99a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand All @@ -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
Expand Down

0 comments on commit 471d99a

Please sign in to comment.