From faebde41d237fc9c2521936407e065602e9d44fa Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 3 Oct 2021 01:04:14 -0700 Subject: [PATCH] Cache conda dependencies for Github workflow execution --- .github/workflows/build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31eefc44..bd822804 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,17 +18,27 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache conda + uses: actions/cache@v2 + env: + # Increase this value to reset cache if etc/example-environment.yml has not changed + CACHE_NUMBER: 0 + with: + path: ~/conda_pkgs_dir + key: + ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ + hashFiles('etc/example-environment.yml') }} - uses: conda-incubator/setup-miniconda@v2 with: activate-environment: test environment-file: environment.yml python-version: 3.8 auto-activate-base: false + use-only-tar-bz2: true - name: Conda Info run: | conda info conda list - name: Run Pytest run: | - conda install pytest python -m pytest