Skip to content

Commit

Permalink
CI: Use mamba-org/setup-micromamba@v1 action (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed May 10, 2024
1 parent 13a3a99 commit 332f4d6
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 48 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,24 @@ jobs:
persist-credentials: false

- name: Setup Conda
uses: s-weigand/setup-conda@v1
uses: mamba-org/setup-micromamba@v1
with:
python-version: '3.10'
conda-channels: conda-forge
init-shell: bash
environment-name: docs
create-args: >-
python=3.10
rasterio
xarray
scipy
pyproj
pandoc
- name: Install and Build
shell: bash
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n docs python=3.10 rasterio xarray scipy pyproj pandoc
source activate docs
python -m pip install -e .[all]
python -m pip install -r requirements/doc.txt
sphinx-build -b html docs/ docs/_build/
micromamba run -n docs python -m pip install -e .[all]
micromamba run -n docs python -m pip install -r requirements/doc.txt
micromamba run -n docs sphinx-build -b html docs/ docs/_build/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
74 changes: 36 additions & 38 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,57 +105,55 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Conda
uses: s-weigand/setup-conda@v1
uses: mamba-org/setup-micromamba@v1
with:
python-version: ${{ matrix.python-version }}
conda-channels: conda-forge
init-shell: bash
environment-name: test
create-args: >-
python=${{ matrix.python-version }}
rasterio=${{ matrix.rasterio-version }}
xarray=${{ matrix.xarray-version }}
pyproj
netcdf4
dask
pandoc
- name: Install Env
shell: bash
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
export INSTALL_DEPS='python=${{ matrix.python-version }} rasterio=${{ matrix.rasterio-version }} xarray=${{ matrix.xarray-version }} pyproj netcdf4 dask pandoc'
[ "${{ matrix.run-with-scipy }}" = "YES" ] && export INSTALL_DEPS="${INSTALL_DEPS} scipy"
conda create -n test $INSTALL_DEPS
source activate test
python -m pip install -e .[all]
python -m pip install -r requirements/dev.txt
[ "${{ matrix.run-with-scipy }}" = "YES" ] && micromamba install -n test scipy
micromamba run -n test python -m pip install -e .[all]
micromamba run -n test python -m pip install -r requirements/dev.txt
- name: Check and Log Environment
shell: bash
run: |
source activate test
python -V
python -c "import rioxarray; rioxarray.show_versions();"
conda info
micromamba run -n test python -V
micromamba run -n test python -c "import rioxarray; rioxarray.show_versions();"
micromamba info
- name: pylint
if: matrix.python-version == '3.10'
shell: bash
run: |
source activate test
pylint rioxarray/
micromamba run -n test pylint rioxarray/
- name: mypy
shell: bash
if: matrix.python-version == '3.10'
run: |
source activate test
mypy rioxarray/
micromamba run -n test mypy rioxarray/
- name: Test
shell: bash
run: |
source activate test
pytest --cov-report term-missing --cov=rioxarray --cov-report xml
micromamba run -n test pytest --cov-report term-missing --cov=rioxarray --cov-report xml
- name: Test Build docs
shell: bash
if: contains(matrix.os, 'ubuntu')
run: |
source activate test
sphinx-build -b html docs/ docs/_build/
micromamba run -n test sphinx-build -b html docs/ docs/_build/
- uses: codecov/codecov-action@v4

Expand All @@ -168,25 +166,27 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Conda
uses: s-weigand/setup-conda@v1
uses: mamba-org/setup-micromamba@v1
with:
python-version: '3.10'
conda-channels: conda-forge
init-shell: bash
environment-name: test
create-args: >-
python=3.10
proj
libgdal
cython
netcdf4
- name: Install Env
shell: bash
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n test python=3.10 proj libgdal cython netcdf4
source activate test
python -m pip install \
micromamba run -n test python -m pip install \
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
--no-deps --pre --upgrade \
numpy \
pandas \
scipy;
python -m pip install --upgrade \
micromamba run -n test python -m pip install --upgrade \
git+https://github.com/dask/dask.git@main \
git+https://github.com/dask/distributed.git@main \
git+https://github.com/mapbox/rasterio.git@main \
Expand All @@ -198,13 +198,11 @@ jobs:
- name: Check and Log Environment
shell: bash
run: |
source activate test
python -V
python -c "import rioxarray; rioxarray.show_versions();"
conda info
micromamba run -n test python -V
micromamba run -n test python -c "import rioxarray; rioxarray.show_versions();"
micromamba info
- name: Test
shell: bash
run: |
source activate test
pytest --cov-report term-missing --cov=rioxarray --cov-report xml
micromamba run -n test pytest --cov-report term-missing --cov=rioxarray --cov-report xml

0 comments on commit 332f4d6

Please sign in to comment.