diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 86ad055e..7545b1dd 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -42,13 +42,12 @@ jobs: run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT shell: bash - - name: Restore cache and save updated environment after job - uses: actions/cache@v4 + - name: Restore cache + uses: actions/cache/restore@v4 with: path: ${{ env.CONDA }}/envs - key: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }}-${{ github.run_id }} - restore-keys: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }} - id: cache + key: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }} + id: restore-cache - name: No cache found - Create new environment with Miniforge uses: conda-incubator/setup-miniconda@v3 @@ -60,7 +59,14 @@ jobs: channels: conda-forge conda-remove-defaults: true auto-activate-base: false - if: steps.cache.outputs.cache-hit != 'true' + if: steps.restore-cache.outputs.cache-hit != 'true' + + - name: Save Cache if not hit + uses: actions/cache/save@v4 + with: + path: ${{ env.CONDA }}/envs + key: ${{ steps.restore-cache.outputs.cache-primary-key }} + if: steps.restore-cache.outputs.cache-hit != 'true' - name: Install CADET-Process run: |