dockerfile: |-
  RUN apk add --no-cache build-base git bash
  RUN bash <<NUR
    if [[ "$(ruby -e 'print RUBY_VERSION')" > '3' ]]
    then
      gem update --system
      gem install gem_hadar bundler
    else
      gem install gem_hadar
      gem install bundler -v 2.4.22
    fi
  NUR

script: &script |-
  echo -e "\e[1m"
  ruby -v
  echo -e "\e[0m"
  bundle install --full-index
  bundle exec rake spec

fail_fast: yes

images:
  ruby:3.3-alpine: *script
  ruby:3.2-alpine: *script
  ruby:3.1-alpine: *script
  ruby:3.0-alpine: *script
