Skip to content

Commit

Permalink
Workflows: switch to miniforge. Use mamba command over conda
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc committed Nov 1, 2023
1 parent d674d24 commit fb72b2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Mambaforge and Pip packages
- name: Cache Miniforge and Pip packages
uses: actions/[email protected]
env:
CACHE_NUMBER: 0
Expand All @@ -36,35 +36,34 @@ jobs:
key:
${{runner.os}}-condapkg-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Cache Mambaforge environment
- name: Cache Miniforge environment
uses: actions/[email protected]
id: cache-mambaforge-environment
id: cache-miniforge-environment
env:
CACHE_NUMBER: 0
with:
path: /usr/share/miniconda3/envs/mantidimaging-dev.cache
key:
${{runner.os}}-condaenv-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml', 'setup.py')}}

- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/[email protected]
with:
miniforge-version: latest
miniforge-variant: Mambaforge
activate-environment: mantidimaging-dev
auto-activate-base: false
use-mamba: true

- name: Mantid Imaging developer dependencies
if: steps.cache-mambaforge-environment.outputs.cache-hit != 'true'
if: steps.cache-miniforge-environment.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
conda deactivate
python3 ./setup.py create_dev_env
cp -Ta /usr/share/miniconda3/envs/mantidimaging-dev /usr/share/miniconda3/envs/mantidimaging-dev.cache
- name: Mantid Imaging developer dependencies - from cache
if: steps.cache-mambaforge-environment.outputs.cache-hit == 'true'
if: steps.cache-miniforge-environment.outputs.cache-hit == 'true'
shell: bash -l {0}
run: |
cp -Ta /usr/share/miniconda3/envs/mantidimaging-dev.cache /usr/share/miniconda3/envs/mantidimaging-dev
Expand All @@ -79,7 +78,7 @@ jobs:
shell: bash -l {0}
run: |
mamba env list
python --version; conda list ; pip list
python --version; mamba list ; pip list
- name: Yapf
shell: bash -l {0}
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Mambaforge and Pip packages
- name: Cache Miniforge and Pip packages
uses: actions/[email protected]
env:
CACHE_NUMBER: 0
Expand All @@ -36,18 +36,17 @@ jobs:
key:
${{runner.os}}-condapkg-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/[email protected]
with:
miniforge-version: latest
miniforge-variant: Mambaforge
activate-environment: mantidimaging-dev
auto-activate-base: false
use-mamba: true

- name: Cache Mambaforge environment
- name: Cache Miniforge environment
uses: actions/[email protected]
id: cache-mambaforge-environment
id: cache-miniforge-environment
env:
CACHE_NUMBER: 0
with:
Expand All @@ -56,7 +55,7 @@ jobs:
${{runner.os}}-condaenv-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Mantid Imaging developer dependencies
if: steps.cache-mambaforge-environment.outputs.cache-hit != 'true'
if: steps.cache-miniforge-environment.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
conda deactivate
Expand All @@ -66,7 +65,7 @@ jobs:
shell: bash -l {0}
run: |
mamba env list
python --version; conda list ; pip list
python --version; mamba list ; pip list
- name: Yapf
shell: bash -l {0}
Expand Down

0 comments on commit fb72b2e

Please sign in to comment.