Coder Social home page Coder Social logo

cache's People

Contributors

aiqiaoy avatar akhyarrh avatar chrispat avatar dependabot[bot] avatar dhadka avatar giltho avatar guilleijo avatar hugovk avatar jethas-bennettjones avatar jhutchings1 avatar joshmgross avatar kiprasmel avatar koenpunt avatar konradpabjan avatar koogawa avatar kousu avatar marcono1234 avatar matteeyah avatar noamtamim avatar nogic1008 avatar odin-delrio avatar peter7z avatar poiru avatar pradyunsg avatar rhysd avatar robstoll avatar ry-itto avatar smorimoto avatar thboop avatar zarenner avatar

Watchers

 avatar

cache's Issues

Why?

TravisCI is limited in what folders it will cache, but it is smart about detecting when they have been updated: https://docs.travis-ci.com/user/caching/.

In contrast, GithubCI's caching mechanism expects that you can pre-compute, from only the contents of your repo, a cache key to identify your cache. Caches are write-once in Github. The closest thing to updating a cache is by using restore-keys eg.

    - name: Download annex cache
      id: cache
      uses: actions/cache@v2
      with:
        path: |
          ~/.annex-cache
        key: annex-${{ hashFiles('**/*.nii.gz, **/*.nii') }}
        restore-keys: |
          annex-

In this, annex- is a prefix of every cache, so if the exact cache doesn't exist yet, the most recently generated cache will be downloaded instead.

This is inconvenient, and can even fail if:

  • you haven't precisely pinned your dependencies and they update under you
  • some other content in your cache shifts

I don't want to have to think about all that.

The idea of this fork is to behave more like Travis: download the most recent cache, but then upload. So far, it needs to be used like this:

    - name: caching
      uses: kousu/cache@main
      with:
        path: .cache
        key: mycache-${{ hashFiles('.cache') }}
        restore-keys: |
          mycache-

because I haven't found where or if hashFiles() is available in the Github javascript libraries, it needs to be fed in from the Workflow language. You need to make sure the path used in hashFiles() matches the path used in path: and that the restore-keys: prefix matches the prefix used in key:. Another caveat is that hashFiles is strictly limited, I guess as an anti-abuse measure, to reading files within your repo, so you'll need to, I dunno, rsync or symlink or something to cache things in e.g. ~/.npm or ~/.cache/pip.

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.