language: ruby
dist: trusty
cache: bundler
bundler_args: --without development
# workaround bundler/rubygems version mismatch on new trusty images for ruby 1.9
before_install: gem install bundler -v '1.15.4'

rvm:
  - 2.5
  - 2.7

sudo: false

env:
  - PUPPET_GEM_VERSION='~> 6.0' COVERAGE=yes
  - PUPPET_GEM_VERSION='~> 6.0' FACTER_GEM_VERSION='3.11.2.cfacter.20180612'
  # Latest code from puppetlabs/puppet.git
  - PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#master'

matrix:
  include:
    # these versions are explicitly needed for ruby 1.8.7 support
    - rvm: 1.8.7
      env: PUPPET_GEM_VERSION='~> 3.8.0' RSPEC_GEM_VERSION='= 3.1.0'
    - rvm: 1.8.7
      env: PUPPET_GEM_VERSION='~> 2.7.0' RSPEC_GEM_VERSION='~> 2.14.0' FACTER_GEM_VERSION='~> 1.0'
    - rvm: 1.9.3
      env: PUPPET_GEM_VERSION='~> 4.0'
    - rvm: 2.1
      env: PUPPET_GEM_VERSION='~> 4.0'
    - rvm: 2.3
      env: PUPPET_GEM_VERSION='~> 5.5.0'
    - rvm: 2.7
      env: PUPPET_GEM_VERSION='~> 5.5.0'

  allowed_failures:
    # Don't fail for puppet.git#master because it may be to blame for any failures
    - env: PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#master'
    # Don't fail for very old versions of Ruby/Puppet at this point
    - rvm: 1.8.7
    - rvm: 1.9.3

notifications:
  email:
    - tim@sharpe.id.au
