From 1138d777dba6a4178204a684ad18a55c2d41551d Mon Sep 17 00:00:00 2001 From: Dugal Harris Date: Fri, 26 Jan 2024 16:03:33 +0200 Subject: [PATCH] cache packages --- .github/workflows/run-unit-tests_conda-forge.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-unit-tests_conda-forge.yml b/.github/workflows/run-unit-tests_conda-forge.yml index fb5892a..86923a9 100644 --- a/.github/workflows/run-unit-tests_conda-forge.yml +++ b/.github/workflows/run-unit-tests_conda-forge.yml @@ -1,5 +1,5 @@ name: Tests (conda-forge) -# TODO: use libmamba solver and cache packages + on: # push: # branches: [main, feature_pytest_click] @@ -20,6 +20,18 @@ jobs: python-version: ['3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v4 # for the test data + + - name: Get Date + id: get-date + run: echo "week=$(/bin/date -u '+%Y%U')" >> $GITHUB_OUTPUT + shell: bash + + - name: Cache conda + uses: actions/cache@v4 + with: + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.week }}-${{ hashFiles('pyproject.toml') }} + - uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} @@ -28,7 +40,7 @@ jobs: activate-environment: test auto-update-conda: true conda-solver: libmamba -# miniforge-variant: Mambaforge + - name: Install dependencies run: | conda info