version: 2
jobs:
   fedora_bmake:
     working_directory: ~/universal-ctags
     docker:
       - image: docker.io/fedora:latest
     steps:
       - run:
           name: Install Git and Gdb
           command: |
             dnf -y install git gdb
       - checkout
       - run:
           name: Install build tools
           command: |
             dnf -y install gcc automake autoconf pkgconfig bmake aspell-devel aspell-en libxml2-devel jansson-devel libyaml-devel findutils
             dnf -y install jq puppet
       - run:
           name: Build
           command: |
             bash ./autogen.sh
             MAKE=bmake ./configure --enable-debugging
             bmake -j 2
       - run:
           name: Test
           command: |
             MAKE=bmake bmake validate-input check roundtrip CIRCLECI=1

   centos_make:
     working_directory: ~/universal-ctags
     docker:
       - image: docker.io/centos:latest
     steps:
       - run:
           name: Install Git
           command: |
             yum -y install git
       - checkout
       - run:
           name: Install build tools
           # TODO: enable spell checker
           command: |
              yum -y install gcc automake autoconf pkgconfig make libxml2-devel jansson-devel libyaml-devel findutils
       - run:
           name: Build
           command: |
             bash ./autogen.sh
             ./configure --enable-debugging
             make -j 2
       - run:
           name: Test
           command: |
             make check roundtrip CIRCLECI=1

workflows:
  version: 2
  build_and_test:
    jobs:
      - fedora_bmake
      - centos_make
