From 8570f62665c215dcb7b554ea4e7b332e41c5b9a6 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Sun, 28 May 2023 00:41:44 +0200 Subject: [PATCH] Use setup-micromamba for test workflow --- .github/workflows/test.yml | 42 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbcc4f4d5..cb7a4803e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,28 +23,28 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - uses: conda-incubator/setup-miniconda@v2 + + - name: Install Conda environment with Micromamba + uses: mamba-org/setup-micromamba@v1 with: - python-version: ${{ matrix.python-version }} - channels: conda-forge - miniforge-variant: Mambaforge - miniforge-version: 22.9.0-1 - auto-update-conda: false + init-shell: powershell + create-args: >- + python=3.11 + mamba + pip + pytest-cov + pytest-xdist - name: Install dev deps run: | - conda activate test - mamba install pip pytest-cov pytest-xdist python -m pip install -r requirements-dev.txt - name: install conda-lock run: | - conda activate test pip install -e . --force-reinstall - name: run-test run: | - conda activate test copy pyproject.toml "%RUNNER_TEMP%" Xcopy /E /I tests "%RUNNER_TEMP%\\tests" pushd "${RUNNER_TEMP}" @@ -63,25 +63,26 @@ jobs: python-version: [ "3.8", "3.11" ] defaults: run: - shell: bash -l {0} + shell: micromamba-shell {0} env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" steps: - uses: actions/checkout@v3 - - uses: conda-incubator/setup-miniconda@v2 + - uses: mamba-org/setup-micromamba@v1 with: - python-version: ${{ matrix.python-version }} - channels: conda-forge - miniforge-variant: Mambaforge - miniforge-version: 22.9.0-1 - auto-update-conda: false + generate-run-shell: true + init-shell: bash zsh + create-args: >- + python=${{ matrix.python-version }} + mamba + pip + pytest-cov + pytest-xdist - name: Install dev deps run: | - conda activate test - mamba install pip pytest-cov pytest-xdist set -x echo "${PATH}" which pip @@ -91,14 +92,12 @@ jobs: - name: install conda-lock shell: bash -l {0} run: | - conda activate test which pip pip install -e . --force-reinstall - name: run-test shell: bash -l {0} run: | - conda activate test cp pyproject.toml "${RUNNER_TEMP}/" cp -a tests "${RUNNER_TEMP}/" pushd "${RUNNER_TEMP}" @@ -113,7 +112,6 @@ jobs: - name: test-gdal shell: bash -l {0} run: | - conda activate test pushd "${RUNNER_TEMP}/tests/gdal" export TMPDIR="${RUNNER_TEMP}" ls -lah