From 8863ac5fdf2554c4285a43eaef8e29cf00f365c8 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 7 Mar 2020 13:26:48 -0800 Subject: [PATCH] ;ci: github: linux: use smarter caching as in windows workflow --- .github/workflows/linux-nightly.yml | 39 +++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linux-nightly.yml b/.github/workflows/linux-nightly.yml index 534e9827a..4a2f65b68 100644 --- a/.github/workflows/linux-nightly.yml +++ b/.github/workflows/linux-nightly.yml @@ -84,50 +84,67 @@ jobs: steps: - # cached things + # declare/restore cached things - - name: Cache ~/.stack + - name: Cache stack global package db + id: stack-global uses: actions/cache@v1 with: path: ~/.stack - key: ${{ runner.os }}-stack - #key: ${{ runner.os }}-${{ matrix.resolver }}-stack + key: ${{ runner.os }}-stack-global-${{ hashFiles('**.yaml') }} + restore-keys: ${{ runner.os }}-stack-global - - name: Cache ~/.local/bin + - name: show stuff + run: | + ls -lFRa ~/.stack + + - name: Cache stack-installed programs in ~/.local/bin + id: stack-programs uses: actions/cache@v1 with: path: ~/.local/bin - key: ${{ runner.os }}-local-bin + key: ${{ runner.os }}-stack-programs-${{ hashFiles('**.yaml') }} + restore-keys: ${{ runner.os }}-stack-programs + - name: show stuff + run: | + ls -lFRa ~/.local/bin + + # 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 + key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }} + restore-keys: ${{ runner.os }}-stack-work - name: Cache hledger-lib/.stack-work uses: actions/cache@v1 with: path: hledger-lib/.stack-work - key: ${{ runner.os }}-hledger-lib-stack-work + key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }} + restore-keys: ${{ runner.os }}-hledger-lib-stack-work - name: Cache hledger/.stack-work uses: actions/cache@v1 with: path: hledger/.stack-work - key: ${{ runner.os }}-hledger-stack-work + key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }} + restore-keys: ${{ runner.os }}-hledger-stack-work - name: Cache hledger-ui/.stack-work uses: actions/cache@v1 with: path: hledger-ui/.stack-work - key: ${{ runner.os }}-hledger-ui-stack-work + key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }} + restore-keys: ${{ runner.os }}-hledger-ui-stack-work - name: Cache hledger-web/.stack-work uses: actions/cache@v1 with: path: hledger-web/.stack-work - key: ${{ runner.os }}-hledger-web-stack-work + key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }} + restore-keys: ${{ runner.os }}-hledger-web-stack-work # actions