From c61c8a3092819518a0b6fe14cfbdb0743aa8f124 Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Fri, 29 Apr 2022 11:40:02 -0700 Subject: [PATCH 1/2] Revert "Revert "Attempt to improve CI caching (#6534)" (#6543)" This reverts commit 93b88135187b05d182929a4a29850157f0e4f8e0. --- .github/workflows/ci-additional.yaml | 1 + .github/workflows/ci.yaml | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 61b9fc99bd7..0b4e0f185c7 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -69,6 +69,7 @@ jobs: else echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV fi + - name: Cache conda uses: actions/cache@v3 with: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 57ec914f877..53db5d9066d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,12 +82,15 @@ jobs: echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV + # This and the next few are based on https://github.com/conda-incubator/setup-miniconda#caching-environments - name: Cache conda + id: cache-conda uses: actions/cache@v3 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.yml') }} + - uses: conda-incubator/setup-miniconda@v2 with: channels: conda-forge @@ -98,9 +101,18 @@ jobs: python-version: ${{ matrix.python-version }} use-only-tar-bz2: true + - name: Cache conda env + id: cache-env + uses: actions/cache@v3 + with: + path: /usr/share/miniconda/envs/xarray-tests + key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ + hashFiles('ci/requirements/**.yml') }} + - name: Install conda dependencies run: | mamba env update -f $CONDA_ENV_FILE + if: steps.cache-env.outputs.cache-hit != 'true' # We only want to install this on one run, because otherwise we'll have # duplicate annotations. From 27840acb82fd6e09054005a49f9afa6e1c9bfb44 Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Mon, 2 May 2022 22:49:56 -0700 Subject: [PATCH 2/2] Update .github/workflows/ci.yaml --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index abceeef553a..15e8f1c600e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -106,8 +106,7 @@ jobs: uses: actions/cache@v3 with: path: /usr/share/miniconda/envs/xarray-tests - key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ - hashFiles('ci/requirements/**.yml') }} + key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.yml') }}-${{ matrix.env }} - name: Install conda dependencies run: |