Skip to content

Instantly share code, notes, and snippets.

@acburdine
Created January 17, 2017 01:43
Show Gist options
  • Save acburdine/61f4f91bacf6554fccdaa394fd14ebbd to your computer and use it in GitHub Desktop.
Save acburdine/61f4f91bacf6554fccdaa394fd14ebbd to your computer and use it in GitHub Desktop.
Adding Yarn to Travis CI
addons:
apt:
sources:
- sourceline: 'deb https://dl.yarnpkg.com/debian/ stable main'
key_url: 'https://dl.yarnpkg.com/debian/pubkey.gpg'
packages:
- yarn
install:
- yarn
@acburdine
Copy link
Author

acburdine commented Jan 26, 2017

update to those that find this - it turns out Yarn (a slightly older version) comes pre-installed on trusty builds on Travis. For that you'll have to npm i -g yarn unfortunately, installing Yarn the above way doesn't work and you get the outdated version available on Travis.

@kriswill
Copy link

kriswill commented Jul 16, 2018

More recent update for those who find this - Here's how to install the latest version of yarn into Travis's trusty docker container:

language: node_js
node_js: lts/carbon
sudo: false
dist: trusty
cache:
  yarn: true
env:
  global:
    - YARN_VERSION=1.7.0
before_install:
  - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
  - export PATH=$HOME/.yarn/bin:$PATH
install:
  - yarn

if you want a specific version of yarn, just put it into the YARN_VERSION variable... Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment