Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

update/improve travis.yml #4

Merged
merged 1 commit into from Sep 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 19 additions & 8 deletions README.md
Expand Up @@ -30,24 +30,35 @@ Complete configuration for the different [node.js versions](https://github.com/n
# https://github.com/nodejs/LTS
sudo: false
language: node_js
os:
- linux
balupton marked this conversation as resolved.
Show resolved Hide resolved
before_install:
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac'
balupton marked this conversation as resolved.
Show resolved Hide resolved
- 'nvm install-latest-npm'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this installs the latest supported version of npm for the current node version, with logic that is far more accurate than anything else in the ecosystem :-)

Copy link
Member

@balupton balupton Sep 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this functionality should go into the node-upgrade-npm script or become another script — not sure how their functionality differs.

The code inside this snippet should allow easy embedding of the various awesome-travis scripts.

I can make the necessary alterations upon feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the logic is baked into nvm; it’s not a simple mapping (it’s multi step) and i keep it up to date as npm releases new versions. tbh I’d just replace that entire upgrade npm script with this nvm command, since it’s always available in Travis.

install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain what each segment in the before_install and install does, as my travis/bash cripts are nowhere near as gooda as yours it seems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is because the latest npm version that 0.6 and 0.9 support, doesn't support scoped modules, so it uses node 0.8 to install them and then switches back.

Copy link
Member

@balupton balupton Sep 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning towards this being another awesome-travis script as it conflicts with the existing node-install and node-upgrade-npm functionality.

Would be nice for these two parts to become their own scripts for easy embedding/combination with other awesome-travis scripts.

I can make the necessary alterations upon feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line; it just means any package with scoped deps won’t be able to successfully install on 0.6.

I’m confused what conflicts tho, since it’s using nvm already inside Travis.

node_js:
- "0.8" # end of life
- "0.10" # end of life
- "0.12" # end of life
- "4" # maintenance lts
- "6" # active lts
- "11" # current
- "10" # active lts
balupton marked this conversation as resolved.
Show resolved Hide resolved
- "8" # active lts
- "9" # current
- "6" # active lts
- "4" # end of life lts
- "0.12" # end of life
- "0.10" # end of life
- "0.8" # end of life
- "0.6" # end of life
balupton marked this conversation as resolved.
Show resolved Hide resolved
matrix:
fast_finish: true
allow_failures:
- node_js: "0.8"
- node_js: "0.10"
- node_js: "0.12"
- node_js: "0.10"
- node_js: "0.8"
- node_js: "0.6"
balupton marked this conversation as resolved.
Show resolved Hide resolved
cache:
balupton marked this conversation as resolved.
Show resolved Hide resolved
directories:
- $HOME/.npm # npm's cache
- $HOME/.yarn-cache # yarn's cache
- "$(nvm cache dir)" # nvm's cache
```


Expand Down