ci - introduce circle ci 2.0

This commit is contained in:
kumavis 2018-03-09 12:38:28 -08:00
parent 51b806797a
commit a13ed5e65a
2 changed files with 52 additions and 17 deletions

52
.circleci/config.yml Normal file
View File

@ -0,0 +1,52 @@
version: 2
jobs:
build:
# working_directory: ~/mern-starter
# The primary container is an instance of the first list image listed. Your build commands run in this container.
docker:
- image: circleci/node:8-browsers
# # The secondary container is an instance of the second listed image which is run in a common network where ports exposed on the primary container are available on localhost.
# - image: mongo:3.4.4
steps:
- checkout
- run:
name: Update npm
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install npm
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
test:
docker:
- image: circleci/node:8-browsers
steps:
- checkout
- run:
name: Test
command: npm test
# - run:
# name: Generate code coverage
# command: './node_modules/.bin/nyc report --reporter=text-lcov'
# - store_artifacts:
# path: test-results.xml
# prefix: tests
# - store_artifacts:
# path: coverage
# prefix: coverage
workflows:
version: 2
build_and_test:
jobs:
- build
- test:
requires:
- build
filters:
branches:
only: master

View File

@ -1,17 +0,0 @@
machine:
node:
version: 8.1.4
test:
override:
- "npm test"
dependencies:
pre:
- sudo apt-get update
# get latest stable firefox
- sudo apt-get install firefox
- firefox_cmd=`which firefox`; sudo rm -f $firefox_cmd; sudo ln -s `which firefox.ubuntu` $firefox_cmd
# get latest stable chrome
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- sudo apt-get update
- sudo apt-get install google-chrome-stable