diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..18dfc3e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,45 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/node:latest + working_directory: ~/react-cafe-cms + steps: + - checkout + - run: + name: Install pcakage + command: yarn install + - save_cache: + key: dependency-cache-{{ checksum "package.json" }} + paths: + - ~/react-cafe-cms + + test: + docker: + - image: circleci/node:latest + working_directory: ~/react-cafe-cms + steps: + - checkout + - restore_cache: + keys: + # Find a cache corresponding to this specific yarn.lock checksum + # when this file is changed, this key will fail + - dependency-cache-{{ checksum "package.json" }} + - run: + name: Save Jest test results + command: yarn test --ci --testResultsProcessor="jest-junit" + environment: + JEST_JUNIT_OUTPUT: "reports/test-results/jest-junit.xml" + - store_test_results: + path: reports/test-results + - store_artifacts: + path: reports/test-results + +workflows: + version: 2 + build_and_test: + jobs: + - build + - test: + requires: + - build diff --git a/package.json b/package.json index fcaedcc..cbfe5ef 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "enzyme-adapter-react-16": "^1.0.1", "jest": "^21.2.1", "jest-enzyme": "^4.0.0", + "jest-junit": "^3.1.0", "nodemon": "^1.12.1", "react": "^16.0.0", "react-dom": "^16.0.0",