aboutsummaryrefslogtreecommitdiffstats
path: root/.circleci/config.yml
blob: 476b50996b583f595beceefe58355ed0e1a4dbbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
version: 2

workflows:
  version: 2
  build_and_test:
    jobs:
      - build
      - test:
          requires:
            - build
          filters:
            branches:
              only: master


jobs:
  build:
    # working_directory: ~/mern-starter
    # The primary container is an instance of the first list image listed. Your build commands run in this container.
    docker:
      - image: circleci/node:8-browsers
    # # The secondary container is an instance of the second listed image which is run in a common network where ports exposed on the primary container are available on localhost.
    #   - image: mongo:3.4.4
    steps:
      - checkout
      - run:
          name: Update npm
          command: 'sudo npm install -g npm@latest'
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: Install npm
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - node_modules
  test:
    docker:
      - image: circleci/node:8-browsers
    steps:
      - checkout
      - run:
          name: Test
          command: npm test
      # - run:
      #     name: Generate code coverage
      #     command: './node_modules/.bin/nyc report --reporter=text-lcov'
      # - store_artifacts:
      #     path: test-results.xml
      #     prefix: tests
      # - store_artifacts:
      #     path: coverage
      #     prefix: coverage