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

Add DevEx tooling #11

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @DataDog/lang-platform-ruby
4 changes: 2 additions & 2 deletions .github/workflows/build-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -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
#
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.direnv
/vendor/bundle
/Gemfile.lock
/gemfiles/*.gemfile.lock
17 changes: 17 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# For available configuration options, see:
# https://github.com/standardrb/standard
ruby_version: 2.5
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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}"
7 changes: 7 additions & 0 deletions gemfiles/jruby-9.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/jruby-9.3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

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

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/ruby-2.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/ruby-2.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/ruby-2.3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/ruby-2.4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/ruby-2.5.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/ruby-2.6.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
7 changes: 7 additions & 0 deletions gemfiles/ruby-2.7.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "rake"

group :test do
gem "minitest"
end
18 changes: 18 additions & 0 deletions gemfiles/ruby-3.0.gemfile
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions gemfiles/ruby-3.1.gemfile
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions gemfiles/ruby-3.2.gemfile
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions gemfiles/ruby-3.3.gemfile
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions gemfiles/ruby-3.4.gemfile
Original file line number Diff line number Diff line change
@@ -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