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/ubuntu:17.10
  fedora-28:
    <<: *shared
    docker:
      - image: delphes/fedora:28

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