diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..76cc83b18 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,70 @@ + +version: 2.1 + +defaults: &defaults + docker: + - image: cimg/node:13.8.0 + working_directory: ~/project + +commands: + npm_install: + description: "installs npm on a job" + steps: + - run: + name: install npm + command: npm i + +jobs: + build: + <<: *defaults + steps: + - checkout + - npm_install + - save_cache: + key: 'npm-packages' + paths: + - /src/tools + - run: + name: install npm lint + command: npm run lint + + test: + <<: *defaults + steps: + - checkout + - restore_cache: + keys: + - 'npm-packages' + - npm_install + - run: + name: test + command: npm run test + + analyze: + <<: *defaults + steps: + - checkout + - restore_cache: + keys: + - 'npm-packages' + - npm_install + - run: + name: analyze + command: npm audit + - run: + name: Failed Tests + command: echo you failed bro + when: on_fail + + + +workflows: + react-slingshot-workflow: + jobs: + - build + - test: + requires: + - build + - analyze: + requires: + - test diff --git a/README.md b/README.md index 0df1cbc75..fcca3f96d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ +I added a circle-ci CI Pipeline with build, test and analyze jobs. +

+ + --- [![Build status: Linux](https://img.shields.io/travis/coryhouse/react-slingshot.svg?style=flat-square)](https://travis-ci.org/coryhouse/react-slingshot)