<commit_before>version: 2

references:
  container_config: &container_config
    docker:
      - image: circleci/node:8
    working_directory: ~/ant-design

  attach_workspace: &attach_workspace
    attach_workspace:
      at: ~/ant-design

  install_react: &install_react
    run: REACT=15 ./scripts/install-react.sh

  react_15: &react_15
    environment:
      REACT: 15

  react_16: &react_16
    environment:
      REACT: 16

  workflow: &workflow
    jobs:
      - setup:
          filters:
            branches:
              ignore: gh-pages
      - dist:
          requires:
          - setup
      - compile:
          requires:
          - setup
      - lint:
          requires:
            - setup
      - test_dist:
          requires:
            - dist
      - test_lib:
          requires:
            - compile
      - test_es:
          requires:
            - compile
      - test_dom:
          requires:
            - setup
      - test_node:
          requires:
            - setup
      - test_dist_15:
          requires:
            - dist
      - test_lib_15:
          requires:
            - compile
      - test_es_15:
          requires:
            - compile
      - test_dom_15:
          requires:
            - setup
      - test_node_15:
          requires:
            - setup

jobs:
  setup:
    <<: *container_config
    steps:
      - checkout
      - run: node -v
      - run: npm -v
      - run: npm install
      - run:
          command: |
            set +eo
            npm ls
            true
      - persist_to_workspace:
          root: ~/ant-design
          paths:
            - node_modules
      - store_artifacts:
          path: package-lock.json

  dist:
    <<: *container_config
    steps:
      - checkout
      - *attach_workspace
      - run: npm run dist
      - run: node ./tests/dekko/dist.test.js
      - persist_to_workspace:
          root: ~/ant-design
          paths:
            - dist

  compile:
    <<: *container_config
    steps:
      - checkout
      - *attach_workspace
      - run: npm run compile
      - run: node ./tests/dekko/lib.test.js
      - persist_to_workspace:
          root: ~/ant-design
          paths:
            - lib
            - es

  lint:
    <<: *container_config
    steps:
      - checkout
      - *attach_workspace
      - run: npm run lint

  test_dist:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run:
          command: npm test -- -w 1
          environment:
            LIB_DIR: dist

  test_lib:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run:
          command: npm test -- -w 1
          environment:
            LIB_DIR: lib

  test_es:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run:
          command: npm test -- -w 1
          environment:
            LIB_DIR: es

  test_dom:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run: npm test -- -w 1 --coverage
      - run: bash <(curl -s https://codecov.io/bash)

  test_node:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run: npm run test-node -- -w 1

  test_dist_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run:
          command: npm test -- -w 1 -u
          environment:
            LIB_DIR: dist

  test_lib_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run:
          command: npm test -- -w 1 -u
          environment:
            LIB_DIR: lib

  test_es_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run:
          command: npm test -- -w 1 -u
          environment:
            LIB_DIR: es

  test_dom_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run: npm test -- -w 1 -u

  test_node_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run: npm run test-node -- -w 1 -u

workflows:
  version: 2
  build_test:
    <<: *workflow
  nightly:
    <<: *workflow
    triggers:
      - schedule:
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master<commit_msg>Update config.yml<commit_after>version: 2

references:
  container_config: &container_config
    docker:
      - image: circleci/node:8
    working_directory: ~/ant-design

  attach_workspace: &attach_workspace
    attach_workspace:
      at: ~/ant-design

  install_react: &install_react
    run: REACT=15 ./scripts/install-react.sh

  react_15: &react_15
    environment:
      REACT: 15

  react_16: &react_16
    environment:
      REACT: 16

  workflow: &workflow
    jobs:
      - setup:
          filters:
            branches:
              ignore: gh-pages
      - dist:
          requires:
          - setup
      - compile:
          requires:
          - setup
      - lint:
          requires:
            - setup
      - test_dist:
          requires:
            - dist
      - test_lib:
          requires:
            - compile
      - test_es:
          requires:
            - compile
      - test_dom:
          requires:
            - setup
      - test_node:
          requires:
            - setup
      - test_dist_15:
          requires:
            - dist
      - test_lib_15:
          requires:
            - compile
      - test_es_15:
          requires:
            - compile
      - test_dom_15:
          requires:
            - setup
      - test_node_15:
          requires:
            - setup

jobs:
  setup:
    <<: *container_config
    steps:
      - checkout
      - run: node -v
      - run: npm -v
      - run: npm install
      - run:
          command: |
            set +eo
            npm ls
            true
      - persist_to_workspace:
          root: ~/ant-design
          paths:
            - node_modules
      - store_artifacts:
          path: package-lock.json

  dist:
    <<: *container_config
    steps:
      - checkout
      - *attach_workspace
      - run: npm run dist
      - run: node ./tests/dekko/dist.test.js
      - persist_to_workspace:
          root: ~/ant-design
          paths:
            - dist

  compile:
    <<: *container_config
    steps:
      - checkout
      - *attach_workspace
      - run: npm run compile
      - run: node ./tests/dekko/lib.test.js
      - persist_to_workspace:
          root: ~/ant-design
          paths:
            - lib
            - es

  lint:
    <<: *container_config
    steps:
      - checkout
      - *attach_workspace
      - run: npm run lint

  test_dist:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run:
          command: npm test -- -w 1
          environment:
            LIB_DIR: dist

  test_lib:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run:
          command: npm test -- -w 1
          environment:
            LIB_DIR: lib

  test_es:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run:
          command: npm test -- -w 1
          environment:
            LIB_DIR: es

  test_dom:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run: npm test -- -w 1 --coverage
      - run: bash <(curl -s https://codecov.io/bash)

  test_node:
    <<: *container_config
    <<: *react_16
    steps:
      - checkout
      - *attach_workspace
      - run: npm run test-node -- -w 1

  test_dist_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run:
          command: npm test -- -w 1 -u
          environment:
            LIB_DIR: dist

  test_lib_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run:
          command: npm test -- -w 1 -u
          environment:
            LIB_DIR: lib

  test_es_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run:
          command: npm test -- -w 1 -u
          environment:
            LIB_DIR: es

  test_dom_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run: npm test -- -w 1 -u

  test_node_15:
    <<: *container_config
    <<: *react_15
    steps:
      - checkout
      - *attach_workspace
      - *install_react
      - run: npm run test-node -- -w 1 -u

workflows:
  version: 2
  build_test:
    <<: *workflow
  nightly:
    <<: *workflow
    triggers:
      - schedule:
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master

# Configuration for request-info - https://github.com/behaviorbot/request-info

# *Required* Comment to reply with
requestInfoReplyComment: >
  We would appreciate it if you could provide us with more info about this issue/pr! 
  Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository.
  Issues labeled by Need Reproduce will be closed if no activities in 7 days.

# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
requestInfoLabelToAdd: needs-more-info
{'fraction_non_alphanumeric': 0.09562036378416827, 'fraction_numerical': 0.014124580835280967, 'mean_word_length': 1.3294674556213018, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4763171', 'n_tokens_mistral': 3239, 'n_tokens_neox': 3019, 'n_words': 706}