Skip to content

Commit

Permalink
cache node_modules per lockfile hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcath committed Mar 10, 2023
1 parent bd8b96a commit 55a9ba1
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,41 @@ jobs:
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: 💾 Cache Node Modules
id: node-cache
uses: actions/cache@v3
path: /node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
env:
HUSKY_SKIP_INSTALL: true
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm install

lint:
name: 🧼 ESLint
runs-on: ubuntu-latest
needs: prepare
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
install-command: echo "Pre-Cached"
env:
HUSKY_SKIP_INSTALL: true

- name: 💾 Cache Node Modules
id: node-cache
uses: actions/cache@v3
path: /node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: 🧼 Lint
run: npm run lint

Expand Down

0 comments on commit 55a9ba1

Please sign in to comment.