Git Product home page Git Product logo

ezcache's People

Contributors

dhadka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ezcache's Issues

Reenable local tests

I disabled the local storage tests since I don't always have a self-hosted runner available, causing the tests to fail. I think the best way to handle this is to move the local storage tests to a separate workflow file and use the path filter to only run when the local storage code changes.

add handler for node_module

First of all, thanks for the great library.

I wonder if we can have a handler for node_module. I know it is kind of against the best practice but we are fine to take it.

basically we just need to use key like hash value of yarn.lock and node version.

To do this in actions/cache@v2, it is like

    - name: Get yarn cache directory path
      id: yarn-cache-dir-path
      run: echo "::set-output name=dir::$(yarn cache dir)"
    - name: Cache yarn cache
      uses: actions/cache@v2
      id: cache-yarn-cache
      with:
        path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
        key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
        restore-keys: |
          ${{ runner.os }}-yarn-
    - name: Cache node_modules
      id: cache-node-modules
      uses: actions/cache@v2
      with:
        path: node_modules
        key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
        restore-keys: |
          ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-

Post local cache step is failing

I have self-hosted runner that used this cache action in way described in docs:

name: myworkflow

on:
  push:
    branches:
      - master

jobs:
  dependencies:
    concurrency:
      group: "publish"
      cancel-in-progress: true
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'

      - uses: webfactory/[email protected]
        with:
          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

      - uses: actions/setup-node@v2
        with:
          node-version: 12

# Here we start local cache for yarn
      - name: Local cache for yarn
        uses: dhadka/ezcache@master
        with:
          type: yarn
          provider: local

# Here we check cache hit
      - name: Install
        if: steps.cache.outputs.cache-hit != 'true'
        run: |
          yarn install
          
# ...other steps...

When jobs finished, the last step with saving cache is failed with error:

Снимок экрана 2021-05-21 в 15 29 59

Post job cleanup.
Saving cache with Yarn handler
Using LocalStorageProvider
Calling saveCache('/Users/anka/Library/Caches/Yarn/v6', 'macOS--yarn-f2d71935d782918418e11b56a15cb0559fe260de762b383caa47724467a41ebd')
Error: Error: ENOENT: no such file or directory, stat '/Users/anka/Library/Caches/Yarn/v6/npm-node-15.14.0-e7d85644ba65780504dfc7897a6e4a93a5d0e686-integrity/node_modules/node/.bin/node'
Error: Error: ENOENT: no such file or directory, stat '/Users/anka/Library/Caches/Yarn/v6/npm-node-15.14.0-e7d85644ba65780504dfc7897a6e4a93a5d0e686-integrity/node_modules/node/.bin/node'

Allow using local cache in multiple self-hosted runners

In docs you say:

Stores caches on the local file system. Please note that caches can only be shared between jobs on the same machine. Therefore, avoid using when multiple self-hosted runners are registered or on hosted runners.

But, if I have 5 self-hosted runner, that can run workflows parallel, I want that each of this machine use its own cache.
For achieve this, we can provide key value, like it @actions/cache and this problem will gone

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.