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 66a78a8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
fetch-depth: 0

- name: Setup miniconda
id: setup_miniconda
continue-on-error: true
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
Expand All @@ -65,9 +67,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 +85,12 @@ jobs:
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV
- name: Install conda-build
id: install_conda_build
continue-on-error: true
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
1 change: 1 addition & 0 deletions .github/workflows/cron-run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:

- name: Install dpnp
id: install_dpnp
continue-on-error: true
run: |
mamba install ${{ env.PACKAGE_NAME }}=${{ steps.find_latest_tag.outputs.tag }} pytest ${{ env.CHANNELS }}
Expand Down

0 comments on commit 66a78a8

Please sign in to comment.