---
language: ruby

cache: bundler
bundler_args: --without development system_tests

before_install:
  - rm Gemfile.lock || true

script:
  - bundle exec rake test SPEC_OPTS='--format documentation'

matrix:
  fast_finish: true
  include:
  - name: "Puppet 5 Unit Tests"
    rvm: 2.4
    env: PUPPET_VERSION="~> 5"
    
  - name: "Puppet 6 Unit Tests"
    rvm: 2.5
    env: PUPPET_VERSION="~> 6"

  # Beaker tests
  - name: "Debian 9 Acceptance Tests"
    env: BEAKER_set=debian-9-64
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

  - name: "Debian 10 Acceptance Tests"
    env: BEAKER_set=default  # Debian 10
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

  - name: "Ubuntu 16.04 Acceptance Tests"
    env: BEAKER_set=ubuntu-1604-64
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

  - name: "Ubuntu 18.04 Acceptance Tests"
    env: BEAKER_set=ubuntu-1804-64
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

---
language: ruby

cache: bundler
bundler_args: --without development system_tests

before_install:
  - rm Gemfile.lock || true
  - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

script:
  - bundle exec rake test SPEC_OPTS='--format documentation'

after_script:
  - docker logout

matrix:
  fast_finish: true
  include:
  - name: "Puppet 5 Unit Tests"
    rvm: 2.4
    env: PUPPET_VERSION="~> 5"
    
  - name: "Puppet 6 Unit Tests"
    rvm: 2.5
    env: PUPPET_VERSION="~> 6"

  # Beaker tests
  - name: "Debian 9 Acceptance Tests"
    env: BEAKER_set=debian-9-64
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

  - name: "Debian 10 Acceptance Tests"
    env: BEAKER_set=default  # Debian 10
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

  - name: "Ubuntu 16.04 Acceptance Tests"
    env: BEAKER_set=ubuntu-1604-64
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

  - name: "Ubuntu 18.04 Acceptance Tests"
    env: BEAKER_set=ubuntu-1804-64
    bundler_args: --without development
    script: bundle exec rake beaker
    services: docker

Fix rate-limiting by Docker hub
Fix rate-limiting by Docker hub
