From ae989dfddbf639b308fccc9e64ba27be94d9a0a6 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sat, 24 Jul 2021 07:28:42 +0530 Subject: [PATCH 1/2] ci: setup npm cache --- .github/workflows/nodejs.yml | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index cc835823..ef6842e1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -33,6 +33,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} + cache: "npm" - name: Use latest NPM run: sudo npm i -g npm @@ -71,6 +72,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} + cache: "npm" - name: Use latest NPM on ubuntu/macos if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' @@ -80,18 +82,6 @@ jobs: if: matrix.os == 'windows-latest' run: npm i -g npm - - name: Get npm cache directory - id: npm-cache - run: | - echo "::set-output name=dir::$(npm config get cache)" - - - uses: actions/cache@v1 - with: - path: ${{ steps.npm-cache.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Install dependencies run: npm i @@ -127,6 +117,7 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + cache: "npm" - name: Use latest NPM on ubuntu/macos if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' @@ -136,18 +127,6 @@ jobs: if: matrix.os == 'windows-latest' run: npm i -g npm - - name: Get npm cache directory - id: npm-cache - run: | - echo "::set-output name=dir::$(npm config get cache)" - - - uses: actions/cache@v1 - with: - path: ${{ steps.npm-cache.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Install dependencies run: npm i From 14446badd0705e832d2b2780aff807052f845411 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sat, 24 Jul 2021 07:30:03 +0530 Subject: [PATCH 2/2] ci: setup npm cache --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index ef6842e1..7b474878 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -114,7 +114,7 @@ jobs: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: "npm"