Skip to content

Commit

Permalink
CI: Use mamba-org/setup-micromamba@v1 action (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored May 13, 2024
1 parent b65f0d5 commit 875df16
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 31 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@ 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
geopandas
odc-geo
pandoc
rasterio
rioxarray
scipy
xarray
- 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 odc-geo geopandas rasterio scipy rioxarray xarray pandoc
source activate docs
python -m pip install -r requirements/doc.txt
python -m pip install -e .
sphinx-build -b html docs/ docs/_build/
micromamba run -n docs python -m pip install -r requirements/doc.txt
micromamba run -n docs python -m pip install -e .
micromamba run -n docs sphinx-build -b html docs/ docs/_build/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
43 changes: 22 additions & 21 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,53 @@ 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 }}
geopandas
netcdf4
odc-geo
pandoc
rasterio
rioxarray
scipy
xarray
- name: Install Env
shell: bash
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n test python=${{ matrix.python-version }} odc-geo geopandas rasterio scipy rioxarray xarray netcdf4 pandoc
source activate test
python -m pip install -r requirements/dev.txt
python -m pip install -e .
micromamba run -n test python -m pip install -r requirements/dev.txt
micromamba run -n test python -m pip install -e .
- name: Check and Log Environment
shell: bash
run: |
source activate test
python -V
python -c "import geocube; geocube.show_versions();"
conda info
micromamba run -n test python -V
micromamba run -n test python -c "import geocube; geocube.show_versions();"
micromamba info
- name: Pylint
shell: bash
run: |
source activate test
python -m pylint geocube
micromamba run -n test python -m pylint geocube
- name: mypy
shell: bash
run: |
source activate test
python -m mypy geocube/
micromamba run -n test python -m mypy geocube/
- name: Test
shell: bash
run: |
source activate test
pytest --cov-report term-missing --cov=geocube --cov-report xml
micromamba run -n test pytest --cov-report term-missing --cov=geocube --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

0 comments on commit 875df16

Please sign in to comment.