Skip to content

Commit ba9c4db

Browse files
committed
CI: micromamba and environment caching
1 parent 641fbce commit ba9c4db

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/actions/install-parcels/action.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Setup Conda and install parcels
22
description: >
3-
In-repo composite action to setup Conda and install parcels. Installation of parcels relies on
4-
`setup.py` file being available in the root. For general setup of Anaconda environments, just use
3+
In-repo composite action to setup micromamba and install parcels. For general setup of Anaconda environments, you can also use
54
the `conda-incubator/setup-miniconda` action (setting C variables as required).
65
inputs:
76
environment-file:
@@ -13,20 +12,27 @@ inputs:
1312
runs:
1413
using: "composite"
1514
steps:
15+
- name: Set environment variables
16+
shell: bash -l {0}
17+
run: |
18+
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
1619
- name: Configure pagefile # Windows compatability fix as per PR #1279
1720
if: ${{ runner.os == 'Windows' }}
1821
uses: al-cheb/[email protected]
1922
with:
2023
minimum-size: 8GB
21-
- name: Install miniconda (${{ inputs.environment-file }})
22-
uses: conda-incubator/setup-miniconda@v3
24+
- name: Setup micromamba
25+
uses: mamba-org/setup-micromamba@v2
2326
with:
2427
environment-file: ${{ inputs.environment-file }}
25-
python-version: ${{ inputs.python-version }}
26-
channels: conda-forge
28+
environment-name: parcels-dev
29+
cache-environment: true
30+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{inputs.python-version}}-${{env.TODAY}}-${{hashFiles(inputs.environment-file)}}"
31+
create-args: >-
32+
python=${{inputs.python-version}}
2733
- name: MPI support
2834
if: ${{ ! (runner.os == 'Windows') }}
29-
run: conda install -c conda-forge mpich mpi4py
35+
run: micromamba install -c conda-forge mpich mpi4py -y
3036
shell: bash -el {0}
3137
- name: Install parcels
3238
run: pip install .

0 commit comments

Comments
 (0)