Skip to content

Commit 5d2d8ba

Browse files
seismanweiji14
andauthored
CI: Use mamba-org/provision-with-micromamba to setup micromamba (#2435)
Co-authored-by: Wei Ji <[email protected]>
1 parent deba1b8 commit 5d2d8ba

File tree

7 files changed

+155
-133
lines changed

7 files changed

+155
-133
lines changed

.github/ISSUE_TEMPLATE/bump_gmt_checklist.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ assignees: ''
1717
**To-Do for bumping the GMT version in CI**:
1818

1919
- [ ] Bump the GMT version in CI (1 PR)
20+
- [ ] Update `environment.yml`
21+
- [ ] Update `ci/requirements/docs.yml`
2022
- [ ] Update `.github/workflows/cache_data.yaml`
23+
- [ ] Update `.github/workflows/ci_doctests.yaml`
2124
- [ ] Update `.github/workflows/ci_docs.yml`
2225
- [ ] Update `.github/workflows/ci_tests.yaml`
23-
- [ ] Update `ci/requirements/docs.yml`
24-
- [ ] Update `environment.yml`
26+
- [ ] Add the legacy GMT version to `.github/workflows/ci_tests_legacy.yaml`
2527
- [ ] Fix failing tests (1 or more PRs)
2628
- [ ] Fix [xfail](https://docs.pytest.org/en/stable/skipping.html#xfail-mark-test-functions-as-expected-to-fail) pytest markers on tests that are now xpass
2729

@@ -31,5 +33,6 @@ assignees: ''
3133
- [ ] Update `required_version` in `pygmt/clib/session.py`
3234
- [ ] Update `test_get_default` in `pygmt/tests/test_clib.py`
3335
- [ ] Update compatibility table in `README.rst`
36+
- [ ] Remove unsupported GMT version from `.github/workflows/ci_tests_legacy.yaml`
3437
- [ ] Remove [xfail](https://docs.pytest.org/en/stable/skipping.html#xfail-mark-test-functions-as-expected-to-fail) pytest markers on tests that are now xpass
3538
- [ ] Update deprecated syntax in source code and examples based on the [GMT Changelog](https://docs.generic-mapping-tools.org/latest/changes.html)

.github/workflows/cache_data.yaml

+13-15
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,21 @@ jobs:
3333
# fetch all history so that setuptools-scm works
3434
fetch-depth: 0
3535

36-
# Install Mambaforge with conda-forge dependencies
37-
- name: Setup Mambaforge
38-
uses: conda-incubator/[email protected]
36+
- name: Setup Micromamba
37+
uses: mamba-org/provision-with-micromamba@v15
3938
with:
39+
environment-name: pygmt
40+
environment-file: false
4041
channels: conda-forge,nodefaults
41-
channel-priority: strict
42-
miniforge-version: latest
43-
miniforge-variant: Mambaforge
44-
mamba-version: "*"
45-
run-post: false
46-
use-mamba: true
47-
48-
# Install GMT and other required dependencies from conda-forge
49-
- name: Install dependencies
50-
run: |
51-
mamba install gmt=6.4.0 numpy pandas xarray netCDF4 packaging \
52-
build
42+
extra-specs: |
43+
python=3.11
44+
gmt=6.4.0
45+
numpy
46+
pandas
47+
xarray
48+
netCDF4
49+
packaging
50+
build
5351
5452
# Install the package that we want to test
5553
- name: Install the package

.github/workflows/ci_docs.yml

+28-24
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ on:
3131

3232
jobs:
3333
docs:
34-
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
34+
name: ${{ matrix.os }}
3535
runs-on: ${{ matrix.os }}
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
python-version: ['3.11']
4039
os: [ubuntu-latest, macOS-latest, windows-latest]
4140
# Is it a draft Pull Request (true or false)?
4241
isDraft:
@@ -66,30 +65,35 @@ jobs:
6665
# fetch all history so that setuptools-scm works
6766
fetch-depth: 0
6867

69-
# Install Mambaforge with conda-forge dependencies
70-
- name: Setup Mambaforge
71-
uses: conda-incubator/[email protected]
68+
- name: Setup Micromamba
69+
uses: mamba-org/provision-with-micromamba@v15
7270
with:
73-
activate-environment: pygmt
74-
python-version: ${{ matrix.python-version }}
71+
environment-name: pygmt
72+
environment-file: false
7573
channels: conda-forge,nodefaults
76-
channel-priority: strict
77-
miniforge-version: latest
78-
miniforge-variant: Mambaforge
79-
mamba-version: "*"
80-
run-post: false
81-
use-mamba: true
82-
83-
# Install GMT and other required dependencies from conda-forge
84-
- name: Install dependencies
85-
run: |
86-
mamba install gmt=6.4.0 numpy pandas xarray netCDF4 packaging \
87-
build ipython make myst-parser contextily geopandas rioxarray \
88-
sphinx sphinx-copybutton sphinx-design sphinx-gallery sphinx_rtd_theme
89-
90-
# Show installed pkg information for postmortem diagnostic
91-
- name: List installed packages
92-
run: mamba list
74+
cache-downloads: true
75+
cache-env: true
76+
extra-specs: |
77+
python=3.11
78+
gmt=6.4.0
79+
numpy
80+
pandas
81+
xarray
82+
netCDF4
83+
packaging
84+
contextily
85+
geopandas
86+
ipython
87+
rioxarray
88+
build
89+
make
90+
pip
91+
myst-parser
92+
sphinx
93+
sphinx-copybutton
94+
sphinx-design
95+
sphinx-gallery
96+
sphinx_rtd_theme
9397
9498
# Download cached remote files (artifacts) from GitHub
9599
- name: Download remote data from GitHub

.github/workflows/ci_doctests.yaml

+23-24
Original file line numberDiff line numberDiff line change
@@ -40,32 +40,31 @@ jobs:
4040
# fetch all history so that setuptools-scm works
4141
fetch-depth: 0
4242

43-
# Install Mambaforge with conda-forge dependencies
44-
- name: Setup Mambaforge
45-
uses: conda-incubator/[email protected]
43+
- name: Setup Micromamba
44+
uses: mamba-org/provision-with-micromamba@v15
4645
with:
47-
activate-environment: pygmt
48-
python-version: '3.11'
46+
environment-name: pygmt
47+
environment-file: false
4948
channels: conda-forge,nodefaults
50-
channel-priority: strict
51-
miniforge-version: latest
52-
miniforge-variant: Mambaforge
53-
mamba-version: "*"
54-
run-post: false
55-
use-mamba: true
56-
57-
# Install GMT and other required dependencies from conda-forge
58-
- name: Install dependencies
59-
run: |
60-
mamba install gmt=6.4.0 numpy \
61-
pandas xarray netCDF4 packaging \
62-
build make 'pytest>=6.0' \
63-
pytest-cov pytest-doctestplus pytest-mpl sphinx-gallery \
64-
contextily geopandas ipython rioxarray
65-
66-
# Show installed pkg information for postmortem diagnostic
67-
- name: List installed packages
68-
run: mamba list
49+
extra-specs: |
50+
python=3.11
51+
gmt=6.4.0
52+
numpy
53+
pandas
54+
xarray
55+
netCDF4
56+
packaging
57+
contextily
58+
geopandas
59+
ipython
60+
rioxarray
61+
build
62+
make
63+
pip
64+
pytest
65+
pytest-doctestplus
66+
pytest-mpl
67+
sphinx-gallery
6968
7069
# Download cached remote files (artifacts) from GitHub
7170
- name: Download remote data from GitHub

.github/workflows/ci_tests.yaml

+30-25
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ jobs:
6767
optional-packages: ''
6868
- python-version: '3.11'
6969
numpy-version: '1.24'
70-
optional-packages: 'contextily geopandas ipython rioxarray'
70+
optional-packages: |
71+
contextily
72+
geopandas
73+
ipython
74+
rioxarray
75+
7176
timeout-minutes: 30
7277
defaults:
7378
run:
@@ -93,32 +98,32 @@ jobs:
9398
# fetch all history so that setuptools-scm works
9499
fetch-depth: 0
95100

96-
# Install Mambaforge with conda-forge dependencies
97-
- name: Setup Mambaforge
98-
uses: conda-incubator/[email protected]
101+
- name: Setup Micromamba
102+
uses: mamba-org/provision-with-micromamba@v15
99103
with:
100-
activate-environment: pygmt
101-
python-version: ${{ matrix.python-version }}
104+
environment-name: pygmt
105+
environment-file: false
102106
channels: conda-forge,nodefaults
103-
channel-priority: strict
104-
miniforge-version: latest
105-
miniforge-variant: Mambaforge
106-
mamba-version: "*"
107-
run-post: false
108-
use-mamba: true
109-
110-
# Install GMT and other required dependencies from conda-forge
111-
- name: Install dependencies
112-
run: |
113-
mamba install gmt=6.4.0 numpy=${{ matrix.numpy-version }} \
114-
pandas xarray netCDF4 packaging \
115-
${{ matrix.optional-packages }} \
116-
build dvc make 'pytest>=6.0' \
117-
pytest-cov pytest-doctestplus pytest-mpl sphinx-gallery
118-
119-
# Show installed pkg information for postmortem diagnostic
120-
- name: List installed packages
121-
run: mamba list
107+
cache-downloads: true
108+
cache-env: true
109+
extra-specs: |
110+
python=${{ matrix.python-version }}
111+
gmt=6.4.0
112+
numpy=${{ matrix.numpy-version }}
113+
pandas
114+
xarray
115+
netCDF4
116+
packaging
117+
${{ matrix.optional-packages }}
118+
build
119+
dvc
120+
make
121+
pip
122+
pytest
123+
pytest-cov
124+
pytest-doctestplus
125+
pytest-mpl
126+
sphinx-gallery
122127
123128
# Download cached remote files (artifacts) from GitHub
124129
- name: Download remote data from GitHub

.github/workflows/ci_tests_dev.yaml

+30-18
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
python-version: ['3.11']
4241
os: [ubuntu-22.04, macOS-12, windows-2022]
4342
gmt_git_ref: [master]
4443
timeout-minutes: 30
@@ -90,32 +89,45 @@ jobs:
9089
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
9190
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
9291

93-
# Install Mambaforge with conda-forge dependencies
94-
- name: Setup Mambaforge
95-
uses: conda-incubator/[email protected]
92+
- name: Setup Micromamba
93+
uses: mamba-org/provision-with-micromamba@v15
9694
with:
97-
activate-environment: pygmt
98-
# python-version: ${{ matrix.python-version }}
95+
environment-name: pygmt
96+
environment-file: false
9997
channels: conda-forge,nodefaults
100-
channel-priority: strict
101-
miniforge-version: latest
102-
miniforge-variant: Mambaforge
103-
mamba-version: "*"
104-
run-post: false
105-
use-mamba: true
106-
107-
# Install dependencies from conda-forge
98+
cache-downloads: true
99+
cache-env: true
100+
extra-specs: |
101+
python=3.11
102+
cmake
103+
make
104+
ninja
105+
curl
106+
fftw
107+
ghostscript
108+
hdf5
109+
libblas
110+
libcblas
111+
libgdal
112+
liblapack
113+
libnetcdf
114+
pcre
115+
zlib
116+
geopandas
117+
118+
# Install dependencies from PyPI
108119
- name: Install dependencies
109120
run: |
110-
mamba install python=${{ matrix.python-version }} \
111-
ninja cmake libblas libcblas liblapack fftw libgdal \
112-
geopandas ghostscript libnetcdf hdf5 zlib curl pcre make
113121
python -m pip install --pre --prefer-binary \
114122
numpy pandas xarray netCDF4 packaging \
115123
build contextily dvc ipython rioxarray \
116124
'pytest>=6.0' pytest-cov pytest-doctestplus pytest-mpl \
117125
sphinx-gallery
118126
127+
# Show installed pkg information for postmortem diagnostic
128+
- name: List installed packages
129+
run: micromamba list
130+
119131
# Pull baseline image data from dvc remote (DAGsHub)
120132
- name: Pull baseline image data from dvc remote
121133
if: github.event_name == 'schedule'
@@ -139,7 +151,7 @@ jobs:
139151
if: runner.os != 'Windows'
140152

141153
- name: Install GMT dev version from conda-forge (Windows)
142-
run: mamba install -c conda-forge/label/dev gmt
154+
run: micromamba install -c conda-forge/label/dev gmt
143155
if: runner.os == 'Windows'
144156

145157
# Download cached remote files (artifacts) from GitHub

0 commit comments

Comments
 (0)