GithubHelp home page GithubHelp logo

corca-ai / local-cache Goto Github PK

View Code? Open in Web Editor NEW
35.0 2.0 6.0 203 KB

This action allows caching dependencies and build outputs to improve workflow execution time on self hosted machine.

License: MIT License

TypeScript 96.47% JavaScript 3.53%

local-cache's Introduction

Local Cache action

This action allows caching dependencies and build outputs to improve workflow execution time on self hosted machine. Artifacts are cached in the /home/ubuntu/.cache by default.

What's New

v2

  • Caches that have not been accessed over 7 days are cleaned up automatically at post action stage by clean-key.

See the v1 README.md for older updates.

Usage

Pre-requisites

Create a workflow .yml file in your repository's .github/workflows directory.

Inputs

path

Required

A directory to save and restore cache.

key

Required

An explicit key for a cache.

base

Optional

A base directory to save and restore cache.

Default: /home/ubuntu/.cache

clean-key

Optional

If set, caches that have not been accessed over 7 days are cleaned up automatically at post action stage by clean-key.

Outputs

cache-hit

Cache hit or not

Example cache workflow

Restoring and saving cache using a single action

name: Caching Primes

on: push

jobs:
  build:
    runs-on: [self-hosted]

    steps:
      - uses: actions/checkout@v3

      - name: Cache dependencies
        id: cache
        uses: corca-ai/local-cache@v2
        with:
          path: path/to/dependencies
          key: ${{ hashFiles('**/lockfiles') }}

      - name: Install dependencies
        if: steps.cache.outputs.cache-hit != 'true'
        run: /install.sh

      - name: Use dependencies
        run: /run.sh

Cache Limits

Cache limits are defined by the disk space of self-hosted runners. Caches that have not been accessed over 7 days can be cleaned up at post action stage by clean-key, but if you still run out of disk space, you need to manage runners by increasing disk capacity or removing cache on your own.

local-cache's People

Contributors

ryuni-dev avatar seoljiwon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

local-cache's Issues

Support for restore-keys

Any support for the restore-keys from actions/cache@v3 for cache fallback?

      - uses: actions/cache@v3
        name: Composer Cache
        with:
          path: ${{ steps.composer-cache-dir.outputs.dir }}
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-composer-

Error: Unable to locate executable file: mkdir

I got an error when trying this action. Here is the message:
Error: Unable to locate executable file: mkdir. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
I can run "mkdir" directly as a step in the script so I'm not sure what causes it. Is there any other requirement for this action?

Github Action deprecation: node.js update to 20

Hi, i noticed Github is deprecating node.js 16 in favor of 20 by june, see this Github notice, and flagged this.

Would it be possible and easy for you to publish a new version of this action with the updated Node.js by then? I am afraid i am a newbie and i don't know how easy it is

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.