From 875df1674c3a4c7866dd8a2d3383c168f1e5b6a5 Mon Sep 17 00:00:00 2001 From: "Alan D. Snow" Date: Mon, 13 May 2024 08:51:54 -0500 Subject: [PATCH] CI: Use mamba-org/setup-micromamba@v1 action (#173) --- .github/workflows/build_docs.yaml | 25 +++++++++++------- .github/workflows/tests.yaml | 43 ++++++++++++++++--------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index e8e2ad2..2cb875c 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -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 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5cac7c6..ac504b3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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