version: 2

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

jobs:
  ubuntu-1404:
    <<: *shared
    docker:
      - image: delphes/ubuntu:14.04
  ubuntu-1804:
    <<: *shared
    docker:
      - image: delphes/ubuntu:18.04
  fedora-30:
    <<: *shared
    docker:
      - image: delphes/fedora:30

workflows:
  version: 2
  test:
    jobs:
      - ubuntu-1404
      - ubuntu-1804
      - fedora-30
