From 9b5e571b88e15d075d336b23f4c4b87e2416a4f6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 20 Apr 2020 09:06:29 -0700 Subject: CI: be more selective about caching. Only use the cache if stack.yaml or cabal.project hasn't changed. --- .github/workflows/ci.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b0e04c2f..05bb75f7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,8 +68,6 @@ jobs: with: path: ~/.cabal key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global - name: Cache cabal work id: cabal-local @@ -77,8 +75,6 @@ jobs: with: path: dist-newstyle key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local - restore-keys: | - ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local - name: Install dependencies run: | @@ -113,15 +109,14 @@ jobs: uses: actions/cache@v1 with: path: C:\Users\runneradmin\AppData\Roaming\stack\ - key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }} - restore-keys: ${{ runner.os }}-appdata-roaming-stack + key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('stack.yaml') }} # stack's local package dbs for the project and each package # - name: Cache .stack-work # uses: actions/cache@v1 # with: # path: .stack-work - # key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }} + # key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }} # restore-keys: ${{ runner.os }}-stack-work - name: Install dependencies @@ -152,10 +147,7 @@ jobs: uses: actions/cache@v1 with: path: ~/.stack - key: ${{ runner.os }}-stack-global-${{ hashFiles('**.yaml') }} - restore-keys: | - ${{ runner.os }}-stack-global - ${{ runner.os }}-stack + key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }} # stack's local package db # - name: Cache .stack-work -- cgit v1.2.3