travis-ci / travis-yaml

parses, normalizes, validates and serializes your .travis.yml
http://yaml.travis-ci.org/
MIT License
170 stars 66 forks source link

Validation fails for cache: yarn #111

Open rajinder-yadav opened 7 years ago

rajinder-yadav commented 7 years ago

Note sure where to log this issuse, so putting it here. The following validation should pass, according to this: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#Travis-CI-supports-yarn

sudo: false
language: node_js
cache: yarn
notifications:
  email: false
node_js:
  - "7"
  - "6"
  - "5"
  - "4"
script:
  - yarn test
branches:
  only:
    - master
matrix:
  fast_finish: true

However it fails on: http://lint.travis-ci.org/

error

badersur commented 7 years ago

I have a similar issue!

I'm using:

language: node_js
node_js: '7'
cache:
  yarn: true
  directories:
    - node_modules # NPM packages

Based on https://docs.travis-ci.com/user/caching/#Configuration and https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#Travis-CI-supports-yarn but I get:

mohitgarg commented 7 years ago

I have the same issue as well

language: node_js
node_js:
  - 7
  - 6
  - 5
cache:
  yarn: true
  directories:
    - node_modules
waleedahmed3045 commented 6 years ago

This issue still exists. For more than a year now

josejulio commented 6 years ago

I'm having the same issue, is this a problem with the linter or also affects the cache?

Thana404 commented 5 years ago

I know this issue is kind of old, but I encounter it as well, for "npm" (I'm using Travis CLI 1.8.9 and npm 6.5.0).

cache:
  npm: true
  pip: true
  directories:
  - "/usr/local/bin/"
   - "$HOME/.sonar/cache"

Result:

Warnings for .travis.yml:
[x] in cache section: unexpected key npm, dropping

Or

cache: npm

Result:

Warnings for .travis.yml:
[x] value for cache section is empty, dropping
[x] in cache section: unexpected key npm, dropping

I have the same question as @josejulio

Thanks !

wgoodall01 commented 5 years ago

Same issue here. The workaround of leaving ${HOME}/.cache/yarn under the directories key works, but isn't very elegant.

szerintedmi commented 5 years ago

Is it an issue with travis lint only or cache: yarn doesn't work at all and have to use the directories key method?

wgoodall01 commented 5 years ago

cache: yarn is listed in the caching documentation. It's a shortcut to cache $HOME/.cache/yarn.

orlando commented 5 years ago

so no official comments for more than 2 years? I've just installed the lint to make sure my file is correct and it is reporting nonsense instead.

JensMadsen commented 5 years ago

move to circleci travis sucks