From f1e96f2f9c5a5e9cab068a275f97f621d3f0f563 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 28 Sep 2020 17:52:28 +0200 Subject: [PATCH] github/workflows: include node version in modules cache key --- .github/workflows/chromatic-storybook-test.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/e2e.yml | 2 +- .github/workflows/master.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chromatic-storybook-test.yml b/.github/workflows/chromatic-storybook-test.yml index 0bcaf400d0..bb14e1c38b 100644 --- a/.github/workflows/chromatic-storybook-test.yml +++ b/.github/workflows/chromatic-storybook-test.yml @@ -26,7 +26,7 @@ jobs: uses: actions/cache@v2 with: path: '**/node_modules' - key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} + key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} - name: find location of global yarn cache id: yarn-cache if: steps.cache-modules.outputs.cache-hit != 'true' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 845cec0b0d..65e092676d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: path: '**/node_modules' # We use both yarn.lock and package.json as cache keys to ensure that # changes to local monorepo packages bust the cache. - key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} + key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} # If we get a cache hit for node_modules, there's no need to bring in the global # yarn cache or run yarn install, as all dependencies will be installed already. diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 33fd506f83..e280bf59a3 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -47,7 +47,7 @@ jobs: uses: actions/cache@v2 with: path: '**/node_modules' - key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} + key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} - name: find location of global yarn cache id: yarn-cache if: steps.cache-modules.outputs.cache-hit != 'true' diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 3aa44cbf59..f5029bf836 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -30,7 +30,7 @@ jobs: uses: actions/cache@v2 with: path: '**/node_modules' - key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} + key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }} - name: find location of global yarn cache id: yarn-cache if: steps.cache-modules.outputs.cache-hit != 'true'