From d2dfa445d10bbf38db92e7906bdaf3ec15e2c91d Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Mon, 8 Jan 2024 00:47:17 -0500 Subject: [PATCH] Make cache path a config --- .github/workflows/ci.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 745b3da..45d1350 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,17 +37,19 @@ jobs: activate-environment: pdal-java channels: conda-forge - - name: Get Date - id: get-date - run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT + - name: Conda cache config + id: cache-config + run: | + echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT + echo "path=$CONDA/envs/pdal-java" >> $GITHUB_OUTPUT shell: bash - name: Cache Conda envs uses: actions/cache@v3 with: - path: /usr/share/miniconda/envs/pdal-java + path: ${{ steps.cache-config.outputs.path }} key: - conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }} + conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{ steps.cache-config.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }} env: CACHE_NUMBER: 0 id: conda-cache @@ -108,12 +110,19 @@ jobs: run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT shell: bash + - name: Conda cache config + id: cache-config + run: | + echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT + echo "path=$CONDA/envs/pdal-java" >> $GITHUB_OUTPUT + shell: bash + - name: Cache Conda envs uses: actions/cache@v3 with: - path: /usr/share/miniconda/envs/pdal-java + path: ${{ steps.cache-config.outputs.path }} key: - conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }} + conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{ steps.cache-config.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }} env: CACHE_NUMBER: 0 id: conda-cache