From 4555ba17cf273f9c47f76d90f58cc938a260e0c9 Mon Sep 17 00:00:00 2001 From: Andrei Kazakou Date: Tue, 2 Jul 2024 14:06:41 -0500 Subject: [PATCH] Update cache workflow in Github Actions --- .github/workflows/codeql.yml | 15 ++------------- .github/workflows/validation.yml | 18 +++++------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 39d8ab4..6fdad65 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -53,21 +53,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: "20" - - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Restore cache of Node.js project dependencies - id: cache-node-modules - uses: actions/cache@v3 - env: - cache-name: node_modules - with: - path: node_modules - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Install Node.js project dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --legacy-peer-deps - name: Compile sources to "./compiled" directory diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 1ee4021..23939eb 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -6,25 +6,17 @@ jobs: name: Verifying runs-on: ubuntu-latest steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - name: Checkout source code uses: actions/checkout@v4 - - name: Restore cache of Node.js project dependencies - id: cache-node-modules - uses: actions/cache@v3 - env: - cache-name: node_modules + - name: Setup Node.js + uses: actions/setup-node@v4 with: - path: node_modules - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + node-version: '20' + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Install Node.js project dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --legacy-peer-deps - name: Run lint of code