From 375f9e743cd61205dbc9e2eb712602508d757ce0 Mon Sep 17 00:00:00 2001 From: Ray NG Date: Thu, 26 Oct 2017 09:41:27 +1100 Subject: [PATCH 1/4] add circleci config.yml with Jest test summary setting --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a4a8c22 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,46 @@ +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 "yarn.lock" }} + 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 "yarn.lock" }} + - 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 From 037e21933044617d0fb080972cbd7cb4e13c140c Mon Sep 17 00:00:00 2001 From: Ray NG Date: Thu, 26 Oct 2017 16:56:58 +1100 Subject: [PATCH 2/4] fix identation --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a4a8c22..01f1710 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,6 @@ jobs: - store_artifacts: path: reports/test-results - workflows: version: 2 build_and_test: From 39c52b5902cd1e857785015c26bee323b7ebb449 Mon Sep 17 00:00:00 2001 From: Ray NG Date: Thu, 26 Oct 2017 17:04:39 +1100 Subject: [PATCH 3/4] add jest-junit in package.json --- package.json | 1 + 1 file changed, 1 insertion(+) 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", From 87b44b723663177915bc4f84a886e96be9be5c9f Mon Sep 17 00:00:00 2001 From: Ray NG Date: Thu, 26 Oct 2017 17:05:40 +1100 Subject: [PATCH 4/4] change checksum to package.json --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01f1710..18dfc3e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: name: Install pcakage command: yarn install - save_cache: - key: dependency-cache-{{ checksum "yarn.lock" }} + key: dependency-cache-{{ checksum "package.json" }} paths: - ~/react-cafe-cms @@ -24,7 +24,7 @@ jobs: keys: # Find a cache corresponding to this specific yarn.lock checksum # when this file is changed, this key will fail - - dependency-cache-{{ checksum "yarn.lock" }} + - dependency-cache-{{ checksum "package.json" }} - run: name: Save Jest test results command: yarn test --ci --testResultsProcessor="jest-junit"