Continuous Integration

Yarn can easily be used in various continuous integration systems. To speed up builds, the Yarn cache directory can be saved across builds.

Select the continuous integration system you're using from the options above

Yarn is preinstalled on AppVeyor, so you don’t need to do anything extra in order to use it as part of your build.

To speed up your builds, you can cache Yarn’s cache folder by adding this to your appveyor.yml:

cache:
 - "%LOCALAPPDATA%/Yarn"

On CircleCI, you can install Yarn as part of your build by adding this to your circle.yml file:

dependencies:
  pre:
    # Install Yarn
    - sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
    - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    - sudo apt-get update -qq
    - sudo apt-get install -y -qq yarn
  cache_directories:
    - "~/.yarn-cache"

Let CircleCI know if you want Yarn to be installed by default.

On Codeship, you can install Yarn as part of your build by adding this to your Setup Commands in your project settings:

npm install --global yarn

If you are using Codeship’s Docker Platform, it is recommended to install Yarn via our Debian/Ubuntu package instead.

On Travis CI, you can install Yarn as part of your build by adding this to your .travis.yml file:

before_install:
  # Repo for newer Node.js versions
  - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  # Repo for Yarn
  - sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
  - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  - sudo apt-get update -qq
  - sudo apt-get install -y -qq yarn
cache:
  directories:
  - $HOME/.yarn-cache

Let Travis CI know if you want Yarn to be installed by default.

← Previous: Working with version control