From b1f71a8b3e0b0acfdd7d759c0c14f55bfe19ddb5 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 27 Jun 2018 12:17:09 -0600 Subject: [PATCH] added initial test --- .circleci/config.yml | 75 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1bb4ba12..994b7c1fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,79 @@ +# job_environment will setup the environment for any job being executed. +job_environment: &job_environment + NODE_ENV: test + +# job_defaults applies all the defaults for each job. +job_defaults: &job_defaults + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8 + environment: + <<: *job_environment + version: 2 jobs: + # npm_dependencies will install the dependencies used by all other steps. + npm_dependencies: + <<: *job_defaults + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - restore_cache: + key: dependency-cache-{{ checksum "package-lock.json" }} + - run: + name: Install dependencies + command: npm ci + - save_cache: + key: dependency-cache-{{ checksum "package-lock.json" }} + paths: + - ./node_modules + - persist_to_workspace: + root: . + paths: node_modules + + # lint will perform file linting. + lint: + <<: *job_defaults + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - run: + name: Perform linting + command: npm run lint + + # build will build the static assets and server typescript files. + build: + <<: *job_defaults + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - restore_cache: + keys: + - build-cache-{{ .Branch }}-{{ .Revision }} + - build-cache-{{ .Branch }}- + - build-cache- + - run: + name: Build + command: npm run build + - save_cache: + key: build-cache-{{ .Branch }}-{{ .Revision }} + paths: + - ./dist + - persist_to_workspace: + root: . + paths: dist + workflows: version: 2 + build-and-test: + jobs: + - npm_dependencies + - lint: + requires: + - npm_dependencies + - build: + requires: + - npm_dependencies