From 09c5454255dab536cec85ad4bf257278f751fe13 Mon Sep 17 00:00:00 2001 From: dcherian Date: Mon, 27 Mar 2023 09:05:25 -0600 Subject: [PATCH] Move to micromamba Closes #75 --- .github/workflows/ci.yaml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b30ef5..dcbed0e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,28 +35,23 @@ jobs: echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV - - name: Cache conda - id: cache-conda - uses: actions/cache@v3 + - name: Setup micromamba + uses: mamba-org/provision-with-micromamba@v15 with: - path: ~/conda_pkgs_dir - key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ - hashFiles('ci/**.yml') }} + environment-file: ${{ env.CONDA_ENV_FILE }} + environment-name: xarray-tests + cache-env: true + cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" + extra-specs: | + python=${{matrix.python-version}} + conda - - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - channel-priority: strict - mamba-version: "*" - activate-environment: npg-tests - auto-update-conda: false - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true - - - name: Install conda dependencies + # We only want to install this on one run, because otherwise we'll have + # duplicate annotations. + - name: Install error reporter + if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.10' run: | - mamba env update -f $CONDA_ENV_FILE - if: steps.cache-env.outputs.cache-hit != 'true' + python -m pip install pytest-github-actions-annotate-failures - name: Set up conda environment shell: bash -l {0}