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
cache: - "%LOCALAPPDATA%\\Yarn"
Yarn is pre-installed Codeship Basic.
Travis CI detects the use of Yarn by the presence of
yarn.lock in the repository root. If it is available, Travis CI will install
yarn if necessary, and execute
yarn as the default install command.
If your install phase requires more, it is necessary to install Yarn yourself until it is pre-installed on build images.
There are a couple of ways to install Yarn; one with
sudo, the other without. If you are using the container-based environment use the latter.
sudo: required before_install: # if "install" is overridden # 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: yarn: true
It is recommended that you lock in a specific version of Yarn, so that all your builds use the same version of Yarn, and you can test new Yarn releases before switching over. You can do this by adding the version number to the
apt-get install call:
sudo apt-get install -y -qq yarn=1.3.2-1
Container-based builds do not have the
sudo privilege, so they must rely on other means to install. For example:
sudo: false before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2 - export PATH=$HOME/.yarn/bin:$PATH cache: yarn: true
Semaphore has Yarn pre-installed for all supported Node.js versions, and no user interaction is required for the Yarn cache to work.
To assure that your local Yarn version matches the one on Semaphore, add the lines below to your setup commands, in Project Settings.
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list # install-package is a tool for caching APT installations in Semaphore # defining a package version is optional install-package yarn=<version>
© 2016–2017 Yarn Contributors
Licensed under the BSD License.