From 16855219f8c472124d320f2f2bf88a017ef4c69f Mon Sep 17 00:00:00 2001 From: Bruce Berrios <58147810+Bruception@users.noreply.github.com> Date: Wed, 9 Feb 2022 11:45:27 -0500 Subject: [PATCH] Cache dependencies (#2454) * Cache dependencies * Add linting to pre-commit hook --- .github/workflows/pr-check.yml | 23 ++++++++++++++++++++--- package.json | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 3f066b071..8cbe9ca6b 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -4,16 +4,33 @@ on: push: branches: [master] pull_request: - branches: [master] + branches: [master, api-overhaul] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + 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 up Node.js uses: actions/setup-node@v1 with: node-version: "16.13.2" - - run: npm run install:all - - run: npm run lint + + - name: Install dependencies + run: npm run install:all + + - name: Check for lint + run: npm run lint diff --git a/package.json b/package.json index 53e9a42ca..cad63fee1 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "husky": { "hooks": { - "pre-commit": "pretty-quick --staged" + "pre-commit": "pretty-quick --staged && npm run lint" } } }