Skip to content

Commit b54ec59

Browse files
committed
CI: Replace conda-incubator/setup-miniconda with mamba-org/setup-micromamba in the Benchmarks workflow
1 parent 9d0c02e commit b54ec59

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

.github/workflows/benchmarks.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,36 @@ jobs:
3939
# fetch all history so that setuptools-scm works
4040
fetch-depth: 0
4141

42-
# Install Miniconda with conda-forge dependencies
43-
- name: Setup Miniconda
44-
uses: conda-incubator/[email protected]
45-
with:
46-
auto-activate-base: true
47-
activate-environment: "" # base environment
48-
channels: conda-forge,nodefaults
49-
channel-priority: strict
42+
- name: Get current week number of year
43+
id: date
44+
run: echo "date=$(date +%Y-W%W)" >> $GITHUB_OUTPUT # e.g., 2024-W19
5045

51-
# Install GMT and dependencies from conda-forge
52-
- name: Install dependencies
53-
run: |
54-
# $CONDA is an environment variable pointing to the root of the miniconda directory
55-
# Preprend $CONDA/bin to $PATH so that conda's python is used over system python
56-
echo $CONDA/bin >> $GITHUB_PATH
57-
conda install --solver=libmamba gmt=6.5.0 python=3.12 \
58-
numpy pandas xarray netCDF4 packaging \
59-
geopandas pyarrow pytest pytest-mpl
60-
python -m pip install -U pytest-codspeed setuptools
46+
# Install Micromamba with conda-forge dependencies
47+
- name: Setup Micromamba
48+
uses: mamba-org/[email protected]
49+
with:
50+
environment-name: pygmt
51+
condarc: |
52+
channels:
53+
- conda-forge
54+
- nodefaults
55+
cache-downloads: false
56+
cache-environment: true
57+
# environment cache is persistent for one week.
58+
cache-environment-key: micromamba-environment-${{ steps.date.outputs.date }}
59+
create-args: >-
60+
gmt=6.5.0
61+
python=3.12
62+
numpy
63+
pandas
64+
xarray
65+
netCDF4
66+
packaging
67+
geopandas
68+
pyarrow
69+
pytest
70+
pytest-codspeed
71+
pytest-mpl
6172
6273
# Download cached remote files (artifacts) from GitHub
6374
- name: Download remote data from GitHub
@@ -78,9 +89,6 @@ jobs:
7889
- name: Run benchmarks
7990
uses: CodSpeedHQ/[email protected]
8091
with:
81-
run: |
82-
python -c "import pygmt; pygmt.show_versions()"
83-
PYGMT_USE_EXTERNAL_DISPLAY="false" python -m pytest -r P --pyargs pygmt --codspeed
84-
env:
85-
GMT_LIBRARY_PATH: /usr/share/miniconda/lib/
86-
PROJ_LIB: /usr/share/miniconda/share/proj
92+
# 'bash -el -c' is needed to use the custom shell.
93+
# See https://github.com/CodSpeedHQ/action/issues/65.
94+
run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P --pyargs pygmt --codspeed"

0 commit comments

Comments
 (0)