diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 602afef8..f55ae56b 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -39,11 +39,12 @@ jobs: run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT shell: bash - - name: Restore cache and save updated environment after job + - name: Restore cache uses: actions/cache@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 }} + lookup-only: true id: cache - name: No cache found - Create new environment with Miniforge @@ -58,6 +59,13 @@ jobs: auto-activate-base: false if: steps.cache.outputs.cache-hit != 'true' + - name: Save cache only when it does not exist already + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/cache@v4 + with: + path: ${{ env.CONDA }}/envs + key: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }} + - name: Install CADET-Process run: | pip install -e ./[testing] @@ -67,7 +75,7 @@ jobs: PYTHON_VERSION=$(python --version | awk '{print $2}') REQUIRED_VERSION="${{ matrix.python-version }}.*" echo "Running on Python version: $PYTHON_VERSION" - echo "Required Python version: $REQUIRED_VERSION + echo "Required Python version: $REQUIRED_VERSION" python -m unittest discover -s tests