Switch to circleci (#317)
This commit is contained in:
parent
b8686aeff0
commit
1bb9d091f1
2 changed files with 125 additions and 27 deletions
125
.circleci/config.yml
Normal file
125
.circleci/config.yml
Normal file
|
@ -0,0 +1,125 @@
|
|||
version: 2.1
|
||||
|
||||
commands:
|
||||
test-nodejs:
|
||||
steps:
|
||||
- run:
|
||||
name: Versions
|
||||
command: npm version
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
|
||||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-cache-master-{{ .Environment.CIRCLE_JOB }}
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: npm ci
|
||||
- run:
|
||||
name: Test
|
||||
command: npm test
|
||||
- coverage
|
||||
- save-npm-cache
|
||||
|
||||
test-nodejs-legacy:
|
||||
steps:
|
||||
- run:
|
||||
name: Versions
|
||||
command: npm version
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}
|
||||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-lock-master-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}
|
||||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
|
||||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-cache-master-{{ .Environment.CIRCLE_JOB }}
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: npm install
|
||||
- run:
|
||||
name: Test
|
||||
command: npm test
|
||||
- coverage
|
||||
- save-npm-lock
|
||||
- save-npm-cache
|
||||
save-npm-lock:
|
||||
steps:
|
||||
- save_cache:
|
||||
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- node_modules
|
||||
save-npm-cache:
|
||||
steps:
|
||||
- save_cache:
|
||||
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ arch }}-npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- ~/.npm/_cacache
|
||||
coverage:
|
||||
steps:
|
||||
- run:
|
||||
command: npm run cover
|
||||
- run:
|
||||
command: npm run coveralls
|
||||
|
||||
publish:
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Authenticate with registry
|
||||
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
||||
- run:
|
||||
name: publish to npm
|
||||
command: npm publish
|
||||
|
||||
jobs:
|
||||
node-v4:
|
||||
docker:
|
||||
- image: node:4
|
||||
steps:
|
||||
- test-nodejs-legacy
|
||||
node-v6:
|
||||
docker:
|
||||
- image: node:6
|
||||
steps:
|
||||
- test-nodejs-legacy
|
||||
node-v8:
|
||||
docker:
|
||||
- image: node:8
|
||||
steps:
|
||||
- test-nodejs
|
||||
node-v10:
|
||||
docker:
|
||||
- image: node:10
|
||||
steps:
|
||||
- test-nodejs
|
||||
node-v12:
|
||||
docker:
|
||||
- image: node:12
|
||||
steps:
|
||||
- test-nodejs
|
||||
publish:
|
||||
docker:
|
||||
- image: node:10
|
||||
steps:
|
||||
- publish
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
node-multi-build:
|
||||
jobs:
|
||||
- node-v4
|
||||
- node-v6
|
||||
- node-v8
|
||||
- node-v10
|
||||
- node-v12
|
||||
- publish:
|
||||
requires:
|
||||
- node-v4
|
||||
- node-v6
|
||||
- node-v8
|
||||
- node-v10
|
||||
- node-v12
|
||||
filters:
|
||||
tags:
|
||||
only: /^v.*/
|
||||
branches:
|
||||
ignore: /.*/
|
27
.travis.yml
27
.travis.yml
|
@ -1,27 +0,0 @@
|
|||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
- "4"
|
||||
- "6"
|
||||
- "8"
|
||||
- "10"
|
||||
- "12"
|
||||
|
||||
script:
|
||||
- npm test
|
||||
|
||||
after_script:
|
||||
- npm run cover
|
||||
- npm run coveralls
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- node_js: "0.10"
|
||||
- node_js: "0.12"
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- travis@nodejitsu.com
|
||||
irc: "irc.freenode.org#nodejitsu"
|
Loading…
Reference in a new issue