From 6ff3ee0196e2d1d65516f6f61aeed73c83d9aa26 Mon Sep 17 00:00:00 2001 From: Daniel Macak Date: Tue, 20 Feb 2024 21:12:51 +0100 Subject: [PATCH] build: cache node_modules in CI --- .github/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 204bfe9f..cdc1d24b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,8 +20,15 @@ jobs: node-version: '20' cache: 'yarn' - # TODO cache + - name: Cache node_modules + id: install-cache + uses: actions/cache@v4 + with: + path: 'node_modules' + key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} + - name: Install + if: steps.install-cache.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile - name: Build @@ -30,7 +37,6 @@ jobs: - name: Lint run: yarn lint - # TODO Run as separate job? Only when Install is cached - name: Test run: yarn test:ci