@@ -39,25 +39,36 @@ jobs:
39
39
# fetch all history so that setuptools-scm works
40
40
fetch-depth : 0
41
41
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
50
45
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
+
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
61
72
62
73
# Download cached remote files (artifacts) from GitHub
63
74
- name : Download remote data from GitHub
78
89
- name : Run benchmarks
79
90
uses :
CodSpeedHQ/[email protected]
80
91
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