GithubHelp home page GithubHelp logo

Calculate a default key about cache HOT 2 CLOSED

hugovk avatar hugovk commented on August 18, 2024
Calculate a default key

from cache.

Comments (2)

hugovk avatar hugovk commented on August 18, 2024

Here's what Travis does:

When you have multiple jobs in a build matrix, some characteristics of each job are used to identify the cache each of the jobs should use.

These factors are:

  1. OS name (currently, linux, osx, or windows)
  2. OS distribution (for Linux, xenial, trusty, or precise)
  3. macOS image name (e.g., xcode7.2)
  4. Names and values of visible environment variables set in .travis.yml or Settings panel
  5. Language runtime version (for the language specified in the language key) if applicable
  6. For Bundler-aware jobs, the name of the Gemfile used

If these characteristics are shared by more than one job in a build matrix, they will share the same URL on the network. This could corrupt the cache, or the cache may contain files that are not usable in all jobs using it. In this case, we advise you to add a public environment variable name to each job to create a unique cache entry:

CACHE_NAME=JOB1

https://docs.travis-ci.com/user/caching/#caches-and-build-matrices

So only in very rare situations would you need to define a custom key/name for the cache, and I've never needed to do so.

An example cache zip file from a build is master/cache-linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--python-3.7.tgz.

Thanks! (And thanks for adding caching, it's already speeding up builds considerably! For example, one 98s step -> 27s including cache steps.)

from cache.

chrispat avatar chrispat commented on August 18, 2024

Thank you for the feedback,

GitHub Actions and Travis CI have pretty fundamentally different models. Travis is based around a relatively fixed model of languages and shell scripts and actions is much more generic and open.

Take matrix for example. In GitHub Actions we have no idea what those matrix keys are going to be as that is completely up to the user and the individual action can't use information from any context other than what is supplied by the user.

from cache.

Related Issues (20)

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.