version: 2

shared: &shared
  steps:
    - checkout
    - run:
        name: Build Delphes using make
        command: |
          make distclean
          make -j `nproc` HAS_PYTHIA8=true
    - run:
        name: Build Delphes using cmake
        command: |
          rm -rf build
          mkdir -p build
          cd build
          cmake ..
          make -j `nproc`

jobs:
  ubuntu-1710:
    <<: *shared
    docker:
      - image: delphes/docker-ubuntu-1710:latest
  fedora-28:
    <<: *shared
    docker:
      - image: delphes/docker-fedora-28:latest

workflows:
  version: 2
  test:
    jobs:
      - ubuntu-1710
      - fedora-28
