From 77abba645959186735ab9d599d91b6c5f8f36f47 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 31 Mar 2021 06:37:38 -0700 Subject: [PATCH] Persist yarn cache (#2137) Summary: The time we spend on this isn't much. However, we quite often see flakiness coming from yarnpkg not responding which should hopefully be addressed by this. Pull Request resolved: https://github.com/facebook/flipper/pull/2137 Test Plan: CI Reviewed By: mweststrate Differential Revision: D27461679 Pulled By: passy fbshipit-source-id: c7144d2a8426c078f9cab2d3a94662908a03a182 --- .github/workflows/nodejs.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index f313ccbce..4938d1e52 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -22,6 +22,16 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: yarn install run: yarn working-directory: ${{env.desktop-directory}}