Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ghcr.io/datadog/images-rb images #26

Merged
merged 13 commits into from
Jun 25, 2024
12 changes: 5 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ jobs:
check:
name: Check code
runs-on: ubuntu-latest
container:
image: "ghcr.io/datadog/images-rb/engines/ruby:3.3"

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3.1"
bundler-cache: true
- name: Bundle install
run: bundle install
- name: Bundle list
run: bundle show
- name: Lockfile
Expand All @@ -31,5 +30,4 @@ jobs:
bundle exec rake steep:check || true
- name: Check generators
run: |
# TODO: swallowing result until reproducibility (whitespace diff due to libyaml)
bundle exec rake docker:compose:generate[check] || true
bundle exec rake docker:compose:generate[check]
44 changes: 29 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,38 @@ on:
jobs:
test:
runs-on: ubuntu-latest
name: Test with ${{ matrix.ruby }}
name: Test with ${{ matrix.engine.name }} ${{ matrix.engine.version }}
strategy:
fail-fast: false
matrix:
# Find the versions available at https://github.com/ruby/setup-ruby/blob/master/ruby-builder-versions.json
ruby:
- '3.3.1'
- '3.2.4'
- '3.1.5'
- '3.0.6'
- '2.7.8'
- '2.6.10'
- '2.5.9'
engine:
- name: ruby
version: '3.4'
- name: ruby
version: '3.3'
- name: ruby
version: '3.2'
- name: ruby
version: '3.1'
- name: ruby
version: '3.0'
- name: ruby
version: '2.7'
- name: ruby
version: '2.6'
- name: ruby
version: '2.5'
- name: jruby
version: '9.4'
- name: jruby
version: '9.3'
- name: jruby
version: '9.2'
container:
image: "ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }}"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Bundle install
run: bundle install
- name: Run the test
run: bundle exec rake test spec
63 changes: 63 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@
# This file is generated by 'bundle exec rake docker:compose:generate'
---
services:
jruby-9.2:
build:
context: "."
dockerfile: images/jruby-9.2.dockerfile
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/jruby-9.2.gemfile
stdin_open: true
tty: true
volumes:
- ".:/app"
- bundle-jruby-9.2:/usr/local/bundle
working_dir: "/app"
jruby-9.3:
build:
context: "."
dockerfile: images/jruby-9.3.dockerfile
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/jruby-9.3.gemfile
stdin_open: true
tty: true
volumes:
- ".:/app"
- bundle-jruby-9.3:/usr/local/bundle
working_dir: "/app"
jruby-9.4:
build:
context: "."
dockerfile: images/jruby-9.4.dockerfile
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/jruby-9.4.gemfile
stdin_open: true
tty: true
volumes:
- ".:/app"
- bundle-jruby-9.4:/usr/local/bundle
working_dir: "/app"
ruby-2.5:
build:
context: "."
Expand All @@ -14,6 +53,7 @@ services:
volumes:
- ".:/app"
- bundle-ruby-2.5:/usr/local/bundle
working_dir: "/app"
ruby-2.6:
build:
context: "."
Expand All @@ -26,6 +66,7 @@ services:
volumes:
- ".:/app"
- bundle-ruby-2.6:/usr/local/bundle
working_dir: "/app"
ruby-2.7:
build:
context: "."
Expand All @@ -38,6 +79,7 @@ services:
volumes:
- ".:/app"
- bundle-ruby-2.7:/usr/local/bundle
working_dir: "/app"
ruby-3.0:
build:
context: "."
Expand All @@ -50,6 +92,7 @@ services:
volumes:
- ".:/app"
- bundle-ruby-3.0:/usr/local/bundle
working_dir: "/app"
ruby-3.1:
build:
context: "."
Expand All @@ -62,6 +105,7 @@ services:
volumes:
- ".:/app"
- bundle-ruby-3.1:/usr/local/bundle
working_dir: "/app"
ruby-3.2:
build:
context: "."
Expand All @@ -74,6 +118,7 @@ services:
volumes:
- ".:/app"
- bundle-ruby-3.2:/usr/local/bundle
working_dir: "/app"
ruby-3.3:
build:
context: "."
Expand All @@ -86,11 +131,29 @@ services:
volumes:
- ".:/app"
- bundle-ruby-3.3:/usr/local/bundle
working_dir: "/app"
ruby-3.4:
build:
context: "."
dockerfile: images/ruby-3.4.dockerfile
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-3.4.gemfile
stdin_open: true
tty: true
volumes:
- ".:/app"
- bundle-ruby-3.4:/usr/local/bundle
working_dir: "/app"
volumes:
bundle-jruby-9.2:
bundle-jruby-9.3:
bundle-jruby-9.4:
bundle-ruby-2.5:
bundle-ruby-2.6:
bundle-ruby-2.7:
bundle-ruby-3.0:
bundle-ruby-3.1:
bundle-ruby-3.2:
bundle-ruby-3.3:
bundle-ruby-3.4:
11 changes: 11 additions & 0 deletions gemfiles/jruby-9.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.1.0"

group :test do
# Ruby 2.5 is dropped in version 5.16.0
gem "minitest", "~> 5.15.0"
gem "rspec", "~> 3.13"
end
10 changes: 10 additions & 0 deletions gemfiles/jruby-9.3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.1.0"

group :test do
gem "minitest", "~> 5.22.3"
gem "rspec", "~> 3.13"
end
10 changes: 10 additions & 0 deletions gemfiles/jruby-9.4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.1.0"

group :test do
gem "minitest", "~> 5.22.3"
gem "rspec", "~> 3.13"
end
23 changes: 23 additions & 0 deletions gemfiles/ruby-3.4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.1.0"

group :test do
gem "minitest", "~> 5.22.3"
gem "rspec", "~> 3.13"
end

group :debug do
gem "debug"
gem "irb"
end

group :check do
gem "rubocop", "~> 1.62.1", require: false
gem "rubocop-minitest", "~> 0.33.0", require: false
gem "rubocop-rake", "~> 0.6.0", require: false
gem "standard", "~> 1.0", require: false
gem "steep", "~> 1.6.0", require: false
end
1 change: 1 addition & 0 deletions images/jruby-9.2.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/datadog/images-rb/engines/jruby:9.2
1 change: 1 addition & 0 deletions images/jruby-9.3.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/datadog/images-rb/engines/jruby:9.3
1 change: 1 addition & 0 deletions images/jruby-9.4.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/datadog/images-rb/engines/jruby:9.4
29 changes: 1 addition & 28 deletions images/ruby-2.5.dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
FROM ruby:2.5

# Make apt non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Set language
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# Install RubyGems
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"

# rubygems drops support for ruby 2.5 in 3.4.0
# https://github.com/rubygems/rubygems/blob/master/CHANGELOG.md#340--2022-12-24
#
# 3.3.26 is the last version that supports ruby 2.5
# and installs bundler 2.3.26 as a default gem
RUN gem update --system 3.3.26

ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
FROM ghcr.io/datadog/images-rb/engines/ruby:2.5
29 changes: 1 addition & 28 deletions images/ruby-2.6.dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
FROM ruby:2.6

# Make apt non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Set language
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# Install RubyGems
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"

# rubygems drops support for ruby 2.6 and 2.7 in 3.5.0
# https://github.com/rubygems/rubygems/blob/master/CHANGELOG.md#350--2023-12-15
#
# 3.4.22 is the last version that supports ruby 2.6
# and installs bundler 2.4.22 as a default gem
RUN gem update --system 3.4.22

ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
FROM ghcr.io/datadog/images-rb/engines/ruby:2.6
29 changes: 1 addition & 28 deletions images/ruby-2.7.dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
FROM ruby:2.7

# Make apt non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Set language
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# Install RubyGems
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"

# rubygems drops support for ruby 2.6 and 2.7 in 3.5.0
# https://github.com/rubygems/rubygems/blob/master/CHANGELOG.md#350--2023-12-15
#
# 3.4.22 is the last version that supports ruby 2.7
# and installs bundler 2.4.22 as a default gem
RUN gem update --system 3.4.22

ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
FROM ghcr.io/datadog/images-rb/engines/ruby:2.7
25 changes: 1 addition & 24 deletions images/ruby-3.0.dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
FROM ruby:3.0

# Make apt non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Set language
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# Install RubyGems
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"

# 3.5.10 installs bundler 2.5.10 as a default gem
RUN gem update --system 3.5.10

ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
FROM ghcr.io/datadog/images-rb/engines/ruby:3.0
Loading