chore(actions): cache dependencies

This commit is contained in:
Mrugesh Mohapatra
2020-09-24 23:21:45 +05:30
committed by Mrugesh Mohapatra
parent f5f2fca28c
commit 3ac415154c
3 changed files with 54 additions and 10 deletions

View File

@ -1,9 +1,5 @@
name: Cypress name: Cypress
on: on: [push, pull_request]
push:
pull_request:
branches:
- master
jobs: jobs:
cypress-run: cypress-run:
@ -33,6 +29,19 @@ jobs:
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set Environment variables - name: Set Environment variables
run: cp sample.env .env run: cp sample.env .env

View File

@ -32,6 +32,19 @@ jobs:
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set Environment variables - name: Set Environment variables
run: cp sample.env .env run: cp sample.env .env

View File

@ -1,9 +1,5 @@
name: Node.js CI name: Node.js CI
on: on: [push, pull_request]
push:
pull_request:
branches:
- master
jobs: jobs:
lint: lint:
@ -23,6 +19,19 @@ jobs:
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set Environment variables - name: Set Environment variables
run: cp sample.env .env run: cp sample.env .env
@ -50,6 +59,19 @@ jobs:
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set Environment variables - name: Set Environment variables
run: cp sample.env .env run: cp sample.env .env