diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5627ad7..bdfa80a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -165,28 +165,16 @@ jobs: if: ${{ env.platform == 'x86_64-linux' }} run: make push-image - - name: Restore cached dependencies (Linux only) - if: ${{ env.platform == 'x86_64-linux' }} + - name: Restore cached dependencies uses: actions/cache/restore@v4 id: cache env: key: ${{ runner.os }}-ghc-${{ matrix.ghc-version }}-cabal-${{ matrix.cabal-version }} + paths: ${{ env.platform == 'x86_64-linux' && + "${HOME}/.cache/cabal ${HOME}/.cabal/store dist-newstyle" || + ${{ steps.setup.outputs.cabal-store }} with: - path: | - ${HOME}/.cache/cabal - ${HOME}/.cabal/store - dist-newstyle - key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} - restore-keys: ${{ env.key }}-plan- - - - name: Restore cached dependencies (MacOS and Windows only) - if: ${{ env.platform != 'x86_64-linux' }} - uses: actions/cache/restore@v4 - id: cache - env: - key: ${{ runner.os }}-ghc-${{ matrix.ghc-version }}-cabal-${{ matrix.cabal-version }} - with: - path: ${{ steps.setup.outputs.cabal-store }} + path: ${{ env.paths }} key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} restore-keys: ${{ env.key }}-plan- @@ -214,23 +202,15 @@ jobs: # Cache dependencies already here, so that we do not have to rebuild them # should the subsequent steps fail. - - name: Save cached dependencies (Linux only) - if: ${{ env.platform == 'x86_64-linux' && - steps.cache.outputs.cache-hit != 'true' }} - uses: actions/cache/save@v4 - with: - path: | - ${HOME}/.cache/cabal - ${HOME}/.cabal/store - dist-newstyle - key: ${{ steps.cache.outputs.cache-primary-key }} - - - name: Save cached dependencies (MacOS and Windows only) - if: ${{ env.platform != 'x86_64-linux' && - steps.cache.outputs.cache-hit != 'true' }} + - name: Save cached dependencies + if: ${{ steps.cache.outputs.cache-hit != 'true' }} uses: actions/cache/save@v4 + env: + paths: ${{ env.platform == 'x86_64-linux' && + "${HOME}/.cache/cabal ${HOME}/.cabal/store dist-newstyle" || + ${{ steps.setup.outputs.cabal-store }} with: - path: ${{ steps.setup.outputs.cabal-store }} + path: ${{ env.paths }} key: ${{ steps.cache.outputs.cache-primary-key }} - name: Build