language: ruby
branches:
  only:
    - master

matrix:
  fast_finish: true
  include:
    # Latest versions first
    - name: MRI 2.7.0 Latest
      rvm: 2.7.0
    - name: JRuby 9.2.9.0 Latest on Java 11
      rvm: jruby-9.2.9.0
      jdk: oraclejdk11
    - name: JRuby 9.2.9.0 Latest on Java 8
      rvm: jruby-9.2.9.0
      jdk: openjdk8
    - name: TruffleRuby Latest
      rvm: truffleruby
    - name: YARD uptodate in docs
      rvm: 2.7.0
      script:
      - bundle install --with documentation
      - bundle exec rake yard:master:uptodate

    # Older versions follow
    - name: MRI 2.6.5
      rvm: 2.6.5
    - name: MRI 2.5.7
      rvm: 2.5.7
    - name: MRI 2.4.9
      rvm: 2.4.9
    - name: MRI 2.3.8
      rvm: 2.3.8
    - name: MRI 2.2.10
      rvm: 2.2.10
    - name: MRI 2.1.10
      rvm: 2.1.10
    - name: MRI 2.0.0
      rvm: 2.0.0
    - name: MRI 1.9.3
      rvm: 1.9.3
    - name: JRuby 9.1.17.0
      rvm: jruby-9.1.17.0
      jdk: openjdk8
    - name: JRuby 9.0.5.0
      rvm: jruby-9.0.5.0
      jdk: openjdk8
    - name: JRuby 1.7.27
      rvm: jruby-1.7.27
      jdk: openjdk8

    - name: MRI head
      rvm: ruby-head
    - name: JRuby head
      rvm: jruby-head
      jdk: openjdk8

    - name: Rubinius
      rvm: rbx-3

    - name: Coverage on MRI 2.3.8
      rvm: 2.3.8
      env: COVERAGE=1

  allow_failures:
    - rvm: ruby-head
    - rvm: jruby-head
    - rvm: rbx-3
    - name: TruffleRuby Latest
    - name: YARD uptodate in docs
    - name: JRuby 9.2.9.0 Latest on Java 11

env:
  global:
    - JAVA_OPTS=-Xmx1024m
    - RUBYOPT=-w
    - JRUBY_OPTS=--dev

before_install:
  - gem install bundler --version 1.17.3
  - "echo JAVA_OPTS: $JAVA_OPTS"

script: bundle exec rake ci
