From 1988d63b930d27b0c0b45f3a0d4bf8fbdd0dad2e Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 23 Dec 2024 15:34:03 +0100 Subject: [PATCH] ci: implement npm cache --- .github/workflows/build.yaml | 8 ++++++++ .github/workflows/format.yaml | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c4e85c61..e39ede38 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,6 +15,14 @@ jobs: with: node-version: "20" + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm-cache- + - name: Install dependencies run: npm install diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index dff334ba..952f5f68 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -15,8 +15,17 @@ jobs: with: node-version: "20" + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm-cache- + - name: Install dependencies run: npm install - name: Run format check - run: npm run format + run: | + npm run format