From 9f1cab92ff9404a8306c7eaa269f9560c9007ece Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 14 Nov 2024 10:53:31 +0100 Subject: [PATCH 1/4] Add EditorConfig --- .editorconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eb57fc2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.yml] +indent_style = space +indent_size = 2 + +[*.md.erb] +insert_final_newline = false +trim_trailing_whitespace = false From 997ede9d7113182e7d51e47b50f511948068b06e Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 14 Nov 2024 10:55:19 +0100 Subject: [PATCH 2/4] Add Ruby devex tools --- .rubocop.yml | 17 +++++++++++++++++ .standard.yml | 3 +++ Gemfile | 20 +++++++++++++++++--- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .standard.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..1400412 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,17 @@ +require: + - standard + - standard-custom + - standard-performance + - rubocop-performance + - rubocop-rake + - rubocop-minitest + +inherit_gem: + standard: config/base.yml + standard-custom: config/base.yml + standard-performance: config/base.yml + +AllCops: + TargetRubyVersion: 2.5 + SuggestExtensions: false + NewCops: enable diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 0000000..5852d57 --- /dev/null +++ b/.standard.yml @@ -0,0 +1,3 @@ +# For available configuration options, see: +# https://github.com/standardrb/standard +ruby_version: 2.5 diff --git a/Gemfile b/Gemfile index ba470b5..657d930 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,18 @@ -source 'https://rubygems.org' +source "https://rubygems.org" -gem 'minitest' -gem 'rake' +gem "rake" + +group :test do + gem "minitest" +end + +group :check do + gem "standard" + gem "rubocop" + gem "rubocop-rake" + gem "rubocop-minitest" +end + +group :ide do + gem "ruby-lsp" +end From 0fbfb6bf37820df562d80589ec1e85319c87ecef Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 14 Nov 2024 10:57:38 +0100 Subject: [PATCH 3/4] Add CODEOWNERS --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..5a70a98 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @DataDog/lang-platform-ruby From b094e329dcef1eb0f564ce188d2abf4ec1593eb5 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 14 Nov 2024 11:09:52 +0100 Subject: [PATCH 4/4] Split gemfiles --- .github/workflows/build-ruby.yml | 4 ++-- .gitignore | 1 + Gemfile | 20 +++----------------- gemfiles/jruby-9.2.gemfile | 7 +++++++ gemfiles/jruby-9.3.gemfile | 7 +++++++ gemfiles/jruby-9.4.gemfile | 7 +++++++ gemfiles/ruby-2.1.gemfile | 7 +++++++ gemfiles/ruby-2.2.gemfile | 7 +++++++ gemfiles/ruby-2.3.gemfile | 7 +++++++ gemfiles/ruby-2.4.gemfile | 7 +++++++ gemfiles/ruby-2.5.gemfile | 7 +++++++ gemfiles/ruby-2.6.gemfile | 7 +++++++ gemfiles/ruby-2.7.gemfile | 7 +++++++ gemfiles/ruby-3.0.gemfile | 18 ++++++++++++++++++ gemfiles/ruby-3.1.gemfile | 18 ++++++++++++++++++ gemfiles/ruby-3.2.gemfile | 18 ++++++++++++++++++ gemfiles/ruby-3.3.gemfile | 18 ++++++++++++++++++ gemfiles/ruby-3.4.gemfile | 18 ++++++++++++++++++ 18 files changed, 166 insertions(+), 19 deletions(-) create mode 100644 gemfiles/jruby-9.2.gemfile create mode 100644 gemfiles/jruby-9.3.gemfile create mode 100644 gemfiles/jruby-9.4.gemfile create mode 100644 gemfiles/ruby-2.1.gemfile create mode 100644 gemfiles/ruby-2.2.gemfile create mode 100644 gemfiles/ruby-2.3.gemfile create mode 100644 gemfiles/ruby-2.4.gemfile create mode 100644 gemfiles/ruby-2.5.gemfile create mode 100644 gemfiles/ruby-2.6.gemfile create mode 100644 gemfiles/ruby-2.7.gemfile create mode 100644 gemfiles/ruby-3.0.gemfile create mode 100644 gemfiles/ruby-3.1.gemfile create mode 100644 gemfiles/ruby-3.2.gemfile create mode 100644 gemfiles/ruby-3.3.gemfile create mode 100644 gemfiles/ruby-3.4.gemfile diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index 66831f6..de58bbc 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -86,7 +86,7 @@ jobs: docker run --platform linux/x86_64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} ruby -e 'puts RUBY_DESCRIPTION' docker run --platform linux/x86_64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} gem --version docker run --platform linux/x86_64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} bundle --version - docker run --platform linux/x86_64 --rm -v "${PWD}":"${PWD}" -w "${PWD}" ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} /bin/sh -c 'bundle install && bundle exec rake test' + docker run --platform linux/x86_64 --rm -v "${PWD}":"${PWD}" -w "${PWD}" -e BUNDLE_GEMFILE=gemfiles/${{ matrix.engine }}-${{ matrix.version }}.gemfile ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} /bin/sh -c 'bundle install && bundle exec rake test' # Then, build image for aarch64 which, being emulated under qemu, is slower # @@ -108,7 +108,7 @@ jobs: docker run --platform linux/aarch64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} ruby -e 'puts RUBY_DESCRIPTION' docker run --platform linux/aarch64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} gem --version docker run --platform linux/aarch64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} bundle --version - docker run --platform linux/aarch64 --rm -v "${PWD}":"${PWD}" -w "${PWD}" ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} /bin/sh -c 'bundle install && bundle exec rake test' + docker run --platform linux/aarch64 --rm -v "${PWD}":"${PWD}" -w "${PWD}" -e BUNDLE_GEMFILE=gemfiles/${{ matrix.engine }}-${{ matrix.version }}.gemfile ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} /bin/sh -c 'bundle install && bundle exec rake test' # Finally, assemble multi-arch image for a combined push to the registry # diff --git a/.gitignore b/.gitignore index 9bf08c3..106318a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /.direnv /vendor/bundle /Gemfile.lock +/gemfiles/*.gemfile.lock diff --git a/Gemfile b/Gemfile index 657d930..759fc9f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,18 +1,4 @@ -source "https://rubygems.org" +# frozen_string_literal: true -gem "rake" - -group :test do - gem "minitest" -end - -group :check do - gem "standard" - gem "rubocop" - gem "rubocop-rake" - gem "rubocop-minitest" -end - -group :ide do - gem "ruby-lsp" -end +gemfile = "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION.split(".").take(2).join(".")}.gemfile" +eval_gemfile "gemfiles/#{gemfile}" diff --git a/gemfiles/jruby-9.2.gemfile b/gemfiles/jruby-9.2.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/jruby-9.2.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/jruby-9.3.gemfile b/gemfiles/jruby-9.3.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/jruby-9.3.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/jruby-9.4.gemfile b/gemfiles/jruby-9.4.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/jruby-9.4.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-2.1.gemfile b/gemfiles/ruby-2.1.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/ruby-2.1.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-2.2.gemfile b/gemfiles/ruby-2.2.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/ruby-2.2.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-2.3.gemfile b/gemfiles/ruby-2.3.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/ruby-2.3.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-2.4.gemfile b/gemfiles/ruby-2.4.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/ruby-2.4.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-2.5.gemfile b/gemfiles/ruby-2.5.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/ruby-2.5.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-2.6.gemfile b/gemfiles/ruby-2.6.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/ruby-2.6.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-2.7.gemfile b/gemfiles/ruby-2.7.gemfile new file mode 100644 index 0000000..b3d4cd4 --- /dev/null +++ b/gemfiles/ruby-2.7.gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end diff --git a/gemfiles/ruby-3.0.gemfile b/gemfiles/ruby-3.0.gemfile new file mode 100644 index 0000000..657d930 --- /dev/null +++ b/gemfiles/ruby-3.0.gemfile @@ -0,0 +1,18 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end + +group :check do + gem "standard" + gem "rubocop" + gem "rubocop-rake" + gem "rubocop-minitest" +end + +group :ide do + gem "ruby-lsp" +end diff --git a/gemfiles/ruby-3.1.gemfile b/gemfiles/ruby-3.1.gemfile new file mode 100644 index 0000000..657d930 --- /dev/null +++ b/gemfiles/ruby-3.1.gemfile @@ -0,0 +1,18 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end + +group :check do + gem "standard" + gem "rubocop" + gem "rubocop-rake" + gem "rubocop-minitest" +end + +group :ide do + gem "ruby-lsp" +end diff --git a/gemfiles/ruby-3.2.gemfile b/gemfiles/ruby-3.2.gemfile new file mode 100644 index 0000000..657d930 --- /dev/null +++ b/gemfiles/ruby-3.2.gemfile @@ -0,0 +1,18 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end + +group :check do + gem "standard" + gem "rubocop" + gem "rubocop-rake" + gem "rubocop-minitest" +end + +group :ide do + gem "ruby-lsp" +end diff --git a/gemfiles/ruby-3.3.gemfile b/gemfiles/ruby-3.3.gemfile new file mode 100644 index 0000000..657d930 --- /dev/null +++ b/gemfiles/ruby-3.3.gemfile @@ -0,0 +1,18 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end + +group :check do + gem "standard" + gem "rubocop" + gem "rubocop-rake" + gem "rubocop-minitest" +end + +group :ide do + gem "ruby-lsp" +end diff --git a/gemfiles/ruby-3.4.gemfile b/gemfiles/ruby-3.4.gemfile new file mode 100644 index 0000000..657d930 --- /dev/null +++ b/gemfiles/ruby-3.4.gemfile @@ -0,0 +1,18 @@ +source "https://rubygems.org" + +gem "rake" + +group :test do + gem "minitest" +end + +group :check do + gem "standard" + gem "rubocop" + gem "rubocop-rake" + gem "rubocop-minitest" +end + +group :ide do + gem "ruby-lsp" +end