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 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 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/.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..759fc9f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source 'https://rubygems.org' +# frozen_string_literal: true -gem 'minitest' -gem 'rake' +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