forked from IBM/audit-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
27 lines (23 loc) · 1.08 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
language: node_js
node_js:
- "8"
- "10"
- "14"
install:
- npm ci
# In your code, add this (after installing with `npm install --save-dev audit-ci`):
# scripts:
# # This script should be the first that runs to reduce the risk of
# # executing a script from a compromised NPM package.
# - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then audit-ci -m; fi
# Docs: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#caching-with-npm
# Changelog: https://changelog.travis-ci.com/for-node-js-builds-cache-npm-shortcut-is-available-77295
cache: npm
script:
# Have audit-ci run audit-ci to audit itself :)
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then node lib/audit-ci.js --config ./audit-ci.json; fi
# We support Node.js >= 8 in production. However, we support Node.js >= 10 in development.
# Since prettier v2 supports Node.js >= 10, we can't lint when running Node.js 8.
# This has no impact on our CI since linting while running Node.js 10 is sufficient.
- nodev=$(echo $(node -v) | head -c 1); if [ "$nodev" -gte "10" ]; then npm run lint; fi
- npm run test