version: 2.0

# Default actions to perform on each Emacs version
default: &default-steps
  steps:
    - checkout
    - run: apt-get update
    - run: apt-get install -y openjdk-8-jre
    - run: make

# Enumerated list of Emacs versions
jobs:
  test-emacs-24:
    docker:
      - image: silex/emacs:24
        entrypoint: bash
    <<: *default-steps

  test-emacs-25:
    docker:
      - image: silex/emacs:25
        entrypoint: bash
    <<: *default-steps

  test-emacs-26:
    docker:
      - image: silex/emacs:26.0
        entrypoint: bash
    <<: *default-steps

  test-emacs-master:
    docker:
      - image: silex/emacs:master
        entrypoint: bash
    <<: *default-steps

# Executing in parallel
workflows:
  version: 2
  ci-test-matrix:
    jobs:
      - test-emacs-24
      - test-emacs-25
      - test-emacs-26
      - test-emacs-master
