From e0ff342702e0e36432edb512286764a480dba9e8 Mon Sep 17 00:00:00 2001 From: orangemug Date: Fri, 19 Jan 2018 15:06:23 +0000 Subject: [PATCH] Added yaml inheritance to .circleci/config.yml --- .circleci/config.yml | 52 +++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68a5bdb..772c4c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,32 +1,34 @@ version: 2 +templates: + steps: &steps + - checkout + - run: + name: "Create artifacts directory" + command: mkdir /tmp/artifacts + - restore_cache: + key: v1-dependencies-{{ checksum "package.json" }} + + - run: npm install + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + - run: mkdir -p /tmp/artifacts/logs + - run: npm run build + - run: npm run lint + - run: npm run lint-styles + - run: DOCKER_HOST=localhost npm test + - run: ./node_modules/.bin/istanbul report --include /tmp/artifacts/coverage/coverage.json --dir /tmp/artifacts/coverage html lcov + - store_artifacts: + path: /tmp/artifacts + destination: /artifacts jobs: - build: + build-linux-node-v8: docker: # specify the version you desire here - image: node:8 - image: selenium/standalone-chrome:3.1.0 working_directory: ~/repo - steps: - - checkout - - run: - name: "Create artifacts directory" - command: mkdir /tmp/artifacts - - restore_cache: - key: v1-dependencies-{{ checksum "package.json" }} - - - run: npm install - - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} - - - run: mkdir -p /tmp/artifacts/logs - - run: npm run build - - run: npm run lint - - run: npm run lint-styles - - run: DOCKER_HOST=localhost npm test - - run: ./node_modules/.bin/istanbul report --include /tmp/artifacts/coverage/coverage.json --dir /tmp/artifacts/coverage html lcov - - store_artifacts: - path: /tmp/artifacts - destination: /artifacts + steps: *steps