tunnckoCore/parse-function

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2

defaults: &defaults
  working_directory: ~/parse-function
  docker:
    - image: circleci/node:8@sha256:cf63f9a9a1eed0a978072293a4a4e35a53f0a77655c64a0ad51ca332e138c82a

restore_modules_cache: &restore_modules_cache
  restore_cache:
    keys:
    - parse-function-{{ checksum "yarn.lock" }}
    # fallback to using the latest cache if no exact match is found
    - parse-function-


jobs:
  install:
    <<: *defaults
    steps:
      - checkout
      - *restore_modules_cache
      - run:
          name: Installing Dependencies
          command: yarn install
      - save_cache:
          key: parse-function-{{ checksum "yarn.lock" }}
          paths: node_modules
      - run:
          name: Remove node_modules to cleanup workspace
          command: rm -rf node_modules

  test:
    <<: *defaults
    steps:
      - checkout
      - *restore_modules_cache
      - run:
          name: Running tests and checks
          command: yarn test
      - run:
          name: Sending test coverage to CodeCov
          command: bash <(curl -s https://codecov.io/bash)

  release:
    <<: *defaults
    steps:
      - checkout
      - *restore_modules_cache
      - run:
          name: Building dist files
          command: yarn build
      - run:
          name: Releasing and publishing
          command: yarn run release

workflows:
  version: 2
  automated:
    jobs:
      - install
      - test:
          requires:
            - install
      - release:
          requires:
            - test
          filters:
            branches:
              only: master
          context: org-global