From e22cedb72f0dab98906b4a610586656fccb6ffa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 6 Oct 2018 19:25:51 +0200 Subject: [PATCH] chore: setup circleci --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++ .flowconfig | 3 +++ .gitignore | 1 + package.json | 5 ++++ 4 files changed, 65 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..baeebccf --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,56 @@ +version: 2 + +defaults: &defaults + docker: + - image: circleci/node:10 + working_directory: ~/react-native-testing-library + +jobs: + install-dependencies: + <<: *defaults + steps: + - checkout + - attach_workspace: + at: ~/react-native-testing-library + - restore_cache: + keys: + - dependencies-{{ checksum "package.json" }} + - dependencies- + - run: yarn install --frozen-lockfile + - save_cache: + key: dependencies-{{ checksum "package.json" }} + paths: + - node_modules + - persist_to_workspace: + root: . + paths: + - . + lint-and-flow: + <<: *defaults + steps: + - attach_workspace: + at: ~/react-native-testing-library + - run: | + yarn lint + yarn flow-check + tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/react-native-testing-library + - run: yarn test + - store_artifacts: + path: coverage + destination: coverage + +workflows: + version: 2 + build-and-test: + jobs: + - install-dependencies + - lint-and-flow: + requires: + - install-dependencies + - tests: + requires: + - install-dependencies diff --git a/.flowconfig b/.flowconfig index 1c6fc7fe..d3d2f168 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,2 +1,5 @@ [libs] flow-typed + +[options] +include_warnings=true diff --git a/.gitignore b/.gitignore index eb03e3e1..785cfadf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules *.log +.eslintcache diff --git a/package.json b/package.json index 1b6cbb1f..bf14233d 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,10 @@ }, "dependencies": { "react-is": "^16.5.2" + }, + "scripts": { + "test": "jest", + "flow-check": "flow check", + "lint": "eslint src --cache" } }