From 92cd02cc64c4d76ffb7f70a0e8a366154172576c Mon Sep 17 00:00:00 2001 From: Daniel Beal Date: Mon, 14 Aug 2023 23:22:38 -0700 Subject: [PATCH] better caching --- .github/workflows/test.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 450336d9ae..0fc6ff13a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,10 +40,16 @@ jobs: with: node-version: "16.20.1" cache: "yarn" + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - name: Cache Hardhat artifacts uses: actions/cache@v3 with: - key: hardhat-${{ matrix.workspace }} + key: hardhat-${{ matrix.workspace }}-${{ env.GITHUB_REF }}-${{ steps.date.outputs.date }} + restore-keys: | + hardhat-${{ matrix.workspace }}-${{ env.GITHUB_REF }} + hardhat-${{ matrix.workspace }} path: | markets/**/cache markets/**/artifacts @@ -54,7 +60,10 @@ jobs: - name: Cache Cannon packages uses: actions/cache@v3 with: - key: cannon-${{ matrix.workspace }} + key: cannon-${{ matrix.workspace }}-${{ env.GITHUB_REF }}-${{ steps.date.outputs.date }} + restore-keys: | + cannon-${{ matrix.workspace }}-${{ env.GITHUB_REF }} + cannon-${{ matrix.workspace }} path: | ~/.local/share/cannon