Skip to content

Commit

Permalink
Merge pull request #3 from istana/add-github-actions
Browse files Browse the repository at this point in the history
add github action
  • Loading branch information
istana authored Sep 18, 2024
2 parents fab5d0e + d015119 commit e423eae
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: github-actions-rails

on:
pull_request:
branches: ['*']
push:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', head, truffleruby, truffleruby-head]
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: default
bundler-cache: true
- name: Run tests
env:
RAILS_ENV: test
run: bundle exec rake
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![example workflow](https://github.com/istana/rack-request-object-logger/actions/workflows/ruby.yml/badge.svg)
[![Gem Version](http://img.shields.io/gem/v/rack-request-object-logger.svg?style=flat-square)](https://rubygems.org/gems/rack-request-object-logger)
[![License](http://img.shields.io/:license-apache-blue.svg?style=flat-square)](http://www.apache.org/licenses/LICENSE-2.0.html)

Expand All @@ -21,9 +22,9 @@ gem 'rack-request-object-logger'

## Rubies Support

Tested with Matz Ruby 2.5, 2.6 and Truffleruby.
Tested with Matz Ruby 2.7, 3.0, 3.1, 3.2, 3.3, head, and ruffleruby, truffleruby-head.

Should work with Ruby 2.1+, jRuby and Rubinius 3.69+ (is dead!) and Truffleruby.
Should work also with jRuby, just sqlite3 adapter supports only Rails 7 and tests require a more recent Rails.

## Roadmap

Expand Down
4 changes: 2 additions & 2 deletions performance/active_record_model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class RequestActiveRecordLog < ActiveRecord::Base
end

class CreateRequestActiveRecordLog < ActiveRecord::Migration[7.2]
class CreateRequestActiveRecordLog < ActiveRecord::Migration[7.0]
def change
create_table :request_active_record_logs do |t|
t.text :uid
Expand Down Expand Up @@ -38,6 +38,6 @@ def change
database: 'active_record_performance.sqlite3'
)
CreateRequestActiveRecordLog.migrate(:up)
expect { request.get('http://localhost:4000/doge', rails_headers) }.to perform_at_least(500).ips
expect { request.get('http://localhost:4000/doge', rails_headers) }.to perform_at_least(200).ips.warmup(10)
end
end
2 changes: 1 addition & 1 deletion performance/in_memory_model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
before { allow(RequestDummyLog).to receive(:new).and_return(logger_object) }

it 'much fast. wow' do
expect { request.get('http://localhost:4000/doge', rails_headers) }.to perform_at_least(5000).ips
expect { request.get('http://localhost:4000/doge', rails_headers) }.to perform_at_least(5000).ips.warmup(5)
end
end
6 changes: 4 additions & 2 deletions rack-request-object-logger.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec-benchmark", "~> 0"
spec.add_development_dependency "pry", "~> 0"
spec.add_development_dependency "activerecord", '>= 6.0', "< 8.0"
spec.add_development_dependency "sqlite3", "~> 2.0" unless RUBY_PLATFORM == 'java'
spec.add_development_dependency "mysql2", "~> 0.5" unless RUBY_PLATFORM == 'java'
spec.add_development_dependency "sqlite3", "<= 2.1" unless RUBY_PLATFORM == "java"
end



0 comments on commit e423eae

Please sign in to comment.