-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: micromamba and environment caching
- Loading branch information
1 parent
c067183
commit 48ee59e
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
name: Setup Conda and install parcels | ||
description: > | ||
In-repo composite action to setup Conda and install parcels. Installation of parcels relies on | ||
`setup.py` file being available in the root. For general setup of Anaconda environments, just use | ||
In-repo composite action to setup micromamba and install parcels. For general setup of Anaconda environments, you can also use | ||
the `conda-incubator/setup-miniconda` action (setting C variables as required). | ||
inputs: | ||
environment-file: | ||
|
@@ -13,20 +12,27 @@ inputs: | |
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set environment variables | ||
shell: bash -l {0} | ||
run: | | ||
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- name: Configure pagefile # Windows compatability fix as per PR #1279 | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: al-cheb/[email protected] | ||
with: | ||
minimum-size: 8GB | ||
- name: Install miniconda (${{ inputs.environment-file }}) | ||
uses: conda-incubator/setup-miniconda@v3 | ||
- name: Setup micromamba | ||
uses: mamba-org/setup-micromamba@v2 | ||
with: | ||
environment-file: ${{ inputs.environment-file }} | ||
python-version: ${{ inputs.python-version }} | ||
channels: conda-forge | ||
environment-name: parcels-dev | ||
cache-environment: true | ||
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{inputs.python-version}}-${{env.TODAY}}-${{hashFiles(inputs.environment-file)}}" | ||
create-args: >- | ||
python=${{inputs.python-version}} | ||
- name: MPI support | ||
if: ${{ ! (runner.os == 'Windows') }} | ||
run: conda install -c conda-forge mpich mpi4py | ||
run: micromamba install -c conda-forge mpich mpi4py -y | ||
shell: bash -el {0} | ||
- name: Install parcels | ||
run: pip install . | ||
|