| 1 | # Javascript Node CircleCI 2.0 configuration file |
| 2 | # |
| 3 | # Check https://circleci.com/docs/2.0/language-javascript/ for more details |
| 4 | # |
| 5 | version: 2 |
| 6 | jobs: |
| 7 | build: |
| 8 | docker: |
| 9 | # specify the version you desire here |
| 10 | - image: circleci/node:10.12.0 |
| 11 | |
| 12 | # Specify service dependencies here if necessary |
| 13 | # CircleCI maintains a library of pre-built images |
| 14 | # documented at https://circleci.com/docs/2.0/circleci-images/ |
| 15 | # - image: circleci/mongo:3.4.4 |
| 16 | |
| 17 | working_directory: ~/repo |
| 18 | |
| 19 | steps: |
| 20 | - checkout |
| 21 | |
| 22 | # Download and cache dependencies |
| 23 | - restore_cache: |
| 24 | name: Restore node_modules cache |
| 25 | keys: |
| 26 | - v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} |
| 27 | - v1-node-{{ arch }}-{{ .Branch }}- |
| 28 | - v1-node-{{ arch }}- |
| 29 | |
| 30 | - run: |
| 31 | name: Nodejs Version |
| 32 | command: node --version |
| 33 | |
| 34 | - run: |
| 35 | name: Install Packages |
| 36 | command: yarn install --frozen-lockfile |
| 37 | |
| 38 | - save_cache: |
| 39 | name: Save node_modules cache |
| 40 | key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} |
| 41 | paths: |
| 42 | - node_modules |
| 43 | |
| 44 | - run: |
| 45 | name: Check formatting |
| 46 | command: yarn prettier:ci |
| 47 | |
| 48 | - run: |
| 49 | name: Check lint |
| 50 | command: yarn lint:ci |
| 51 | |
| 52 | - run: |
| 53 | name: Check Flow |
| 54 | command: yarn flow |
| 55 | |
| 56 | - run: |
| 57 | name: Test Packages |
| 58 | command: yarn test |