Skip to content

Commit

Permalink
Merge pull request #15 from planningcenter/ns/simplecache
Browse files Browse the repository at this point in the history
Simplify yarn & npm cache
  • Loading branch information
sheck authored Oct 10, 2024
2 parents 4739ab5 + c02bbb2 commit 3a7a956
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
14 changes: 3 additions & 11 deletions npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,15 @@ runs:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ inputs.node-version }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ inputs.node-version }}-node-modules-
cache: npm
cache-dependency-path: "**/package-lock.json"
- run: npm ci
if: steps.cache-node-modules.outputs.cache-hit != 'true'
shell: bash
inputs:
node-version:
description: Version of node to use
required: false
default: '18'
default: "18"
branding:
icon: life-buoy
color: orange
18 changes: 2 additions & 16 deletions yarn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,8 @@ runs:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ inputs.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ inputs.node-version }}-node-modules-
- name: Cache yarn cache
id: cache-yarn-cache
uses: actions/cache@v3
with:
path: .yarn/cache
key: ${{ runner.os }}-${{ inputs.node-version }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ inputs.node-version }}-yarn-cache-
cache: yarn
cache-dependency-path: "**/yarn.lock"
- run: |
yarn_version=$(yarn --version)
major_version=$(echo "${yarn_version}" | cut -d. -f1)
Expand Down

0 comments on commit 3a7a956

Please sign in to comment.