diff --git a/.circleci/config.yml b/.circleci/config.yml index 9555305..664b106 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,24 +4,55 @@ workflows: build_and_test: jobs: - build + - lint: + requires + - build + - test: + requires + - build + jobs: build: - docker: + docker: - image: cimg/node:14.10.1 # the primary container, where your job's commands are run steps: + - checkout + - run: + name: Install dependencies + command: yarn global add node-gyp && yarn install + - restore_cache: + name: Restore Yarn Package Cache + keys: + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - run: + name: Install Dependencies + command: yarn install --immutable + - save_cache: + name: Save Yarn Package Cache + key: npm-v1-dependencies-{{ checksum "yarn.lock" }} + paths: + - ~/.cache/yarn + lint: + docker: + - image: cimg/node:14.10.1 + steps: - checkout + - restore_cache: + name: Restore Yarn Package Cache + keys: + - npm-v1-dependencies-{{ checksum "yarn.lock" }} - run: - name: Install dependencies - command: yarn global add node-gyp && yarn install + name: "Lint Code" + command: yarn lint && yarn format:check + test: + docker: + - image: cimg/node:14.10.1 + steps: + - checkout - restore_cache: name: Restore Yarn Package Cache keys: - - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - npm-v1-dependencies-{{ checksum "yarn.lock" }} - run: - name: Install Dependencies - command: yarn install --immutable - - save_cache: - name: Save Yarn Package Cache - key: npm-v1-dependencies-{{ checksum "yarn.lock" }} - paths: - - ~/.cache/yarn \ No newline at end of file + name: "Unit Test" + command: yarn test:ci \ No newline at end of file diff --git a/package.json b/package.json index a4f54c1..96ef36c 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json", - "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"./**/*.{yaml,yml}\"", - "format:check": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"./**/*.{yaml,yml}\"", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "format:check": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\"", "generate": "hygen" }, "dependencies": {