added initial test

This commit is contained in:
Wyatt Johnson
2018-06-27 12:17:09 -06:00
parent bcf5658c36
commit b1f71a8b3e
+75
View File
@@ -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