Skip to content

Commit

Permalink
Allow to cache .local folder to speed up builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tcastelli committed Nov 17, 2022
1 parent b9116c0 commit 6ae7cbb
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Files to use as a cache key for global ~~/.npm dependencies'
required: true
default: './package-lock.json'
local-cache-key:
description: "Name assigned to the cache for meteor local when used with multiple settings"
required: true
default: ${{ github.job }}
runs:
using: composite
steps:
Expand Down Expand Up @@ -48,6 +52,23 @@ runs:
run: curl https://install.meteor.com?release=${{ env.METEOR_EXECUTABLE_VERSION }} | sh
shell: bash

- name: Cache .meteor/local
uses: actions/cache@v3
env:
cache-name: cache-meteor-local
with:
path: |
./.meteor/local/resolver-result-cache.json
./.meteor/local/plugin-cache
./.meteor/local/isopacks
./.meteor/local/bundler-cache/scanner
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.local-cache-key }}-${{ env.METEOR_EXECUTABLE_VERSION }}-${{ hashFiles('.meteor/release') }}-${{ hashFiles('.meteor/versions') }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ inputs.local-cache-key }}-${{ env.METEOR_EXECUTABLE_VERSION }}-${{ hashFiles('.meteor/release') }}-${{ hashFiles('.meteor/versions') }}-${{ github.ref }}-
${{ runner.os }}-${{ env.cache-name }}-${{ inputs.local-cache-key }}-${{ env.METEOR_EXECUTABLE_VERSION }}-${{ hashFiles('.meteor/release') }}-${{ hashFiles('.meteor/versions') }}-
${{ runner.os }}-${{ env.cache-name }}-${{ inputs.local-cache-key }}-${{ env.METEOR_EXECUTABLE_VERSION }}-${{ hashFiles('.meteor/release') }}-
${{ runner.os }}-${{ env.cache-name }}-${{ inputs.local-cache-key }}-${{ env.METEOR_EXECUTABLE_VERSION }}-
- name: Get meteor node version
run: echo "NODE_VERSION=$(meteor node -v)" >> $GITHUB_ENV
shell: bash
Expand All @@ -57,4 +78,5 @@ runs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: ${{ inputs.cache-dependency-path}}
cache-dependency-path: ${{ inputs.cache-dependency-path}}

0 comments on commit 6ae7cbb

Please sign in to comment.