Skip to content

Commit

Permalink
Test against latest Ruby and Rails (#326)
Browse files Browse the repository at this point in the history
* Test against latest Ruby and Rails

* Mention contribution guidelines in README
  • Loading branch information
zhuravel authored Sep 4, 2024
1 parent fc7d31d commit 487e1de
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 33 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
rails-version:
- '6.0'
- '6.1'
- '7.0'
name: 'Ruby ${{ matrix.ruby-version }}, Rails ${{ matrix.rails-version }}'
# To keep matrix size down, only test highest and lowest rubies.
ruby: ["2.7", "3.3"]
rails: ["6.1", "7.0", "7.1", "7.2"]
exclude:
- ruby: "2.7"
rails: "7.2"
name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v3
- uses: supercharge/mongodb-github-action@1.9.0
- uses: actions/checkout@v4
- uses: supercharge/mongodb-github-action@1.11.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: '${{ matrix.ruby-version }}'
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
TEST_RAILS_VERSION: '${{ matrix.rails-version }}'
- run: bundle exec rake
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ wiki
.ruby-version
.ruby-gemset
Gemfile.lock
gemfiles/*.gemfile.lock
tmp

27 changes: 27 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
appraise "rails-6.1" do
group :development do
gem "rails", "~> 6.1.0"
end
end

appraise "rails-7.0" do
group :development do
gem "rails", "~> 7.0.0"
end
end

appraise "rails-7.1" do
group :development do
gem "rails", "~> 7.1.0"
end
end

appraise "rails-7.2" do
group :development do
gem "rails", "~> 7.2.0"
gem "sqlite3", "~> 2.0.0"
group :mongo do
gem "mongoid", github: "mongodb/mongoid"
end
end
end
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Treat true/false as YES/NO when assigned as strings for xboolean filter
* Support infinite ranges for date, datetime and integer filters
* Treat `ActiveRecord::Result` class as `Array` driver
* Drop support of Rails 6.0 [#326](https://github.com/bogdan/datagrid/pull/326)

## 1.8.1

Expand All @@ -20,9 +21,9 @@
## 1.7.0

* Depend on `railties` instead of `rails` to prevent loading of unnecessary frameworks
* Bugfix `File.exist?` usage for ruby 3.0 [#307](https://github.com/bogdan/datagrid/issues/307)
* Drop support of old Ruby versions (< 2.7)
* Drop support of old Rails versions (< 6.0)
* Bugfix `File.exist?` usage for Ruby 3.0 [#307](https://github.com/bogdan/datagrid/issues/307)
* Drop support of old Ruby versions (< 2.7) [#305](https://github.com/bogdan/datagrid/pull/305)
* Drop support of old Rails versions (< 6.0) [#305](https://github.com/bogdan/datagrid/pull/305)

## 1.6.3

Expand Down
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contributing to Datagrid

## Issues

Please use GitHub issues for bug reports and feature suggestions.

## Development

### Testing

Tests can be run against different versions of Rails:

**Using appraisals (recommended)**

``` shell
# Install the dependencies for each appraisal
bundle install
bundle exec appraisal install

# Run tests against Rails 7.2
bundle exec appraisal rails-7.2 rake

# Run tests against Rails 6.1
bundle exec appraisal rails-6.1 rake
```

**Using BUNDLE_GEMFILE**

``` shell
# Run tests against Rails 7.2
BUNDLE_GEMFILE=gemfiles/rails_7.2.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/rails_7.2.gemfile bundle exec rake

# Run tests against Rails 6.1
BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle exec rake
```
14 changes: 5 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ source "https://rubygems.org"
gemspec

group :development do
rails_version = ENV['TEST_RAILS_VERSION']
gem "rails", "~> #{rails_version}" if rails_version
gem "appraisal"
gem "bump"

gem "csv" # removed from standard library in Ruby 3.4
gem "nokogiri" # used to test html output
gem "pry-byebug"

gem "rspec"
gem "nokogiri" # used to test html output

gem "sqlite3", '~> 1.4.0'
gem "sequel"
gem "activerecord"
gem "sqlite3", "~> 1.7.0"

group :mongo do
gem "mongoid", '~> 9.0.0'
gem "bson"
gem "mongoid", "~> 9.0"
end
end
8 changes: 4 additions & 4 deletions Readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ A really mighty and flexible ruby library that generates reports including admin

[Create an issue](https://github.com/bogdan/datagrid/issues/new) if you want more.


### Documentation

* [Readme](/Readme.markdown) - this read-me for basic information
Expand Down Expand Up @@ -101,7 +100,6 @@ In order to create a report, you need to define:
* filters that will be used to filter data
* columns that should be displayed and sortable (if possible)


### Scope

Default scope of objects to filter and display.
Expand Down Expand Up @@ -139,7 +137,6 @@ Datagrid supports different type of filters including:

[More about filters](https://github.com/bogdan/datagrid/wiki/Filters)


### Columns

Each column is represented by name and code block to calculate the value.
Expand Down Expand Up @@ -193,6 +190,10 @@ All advanced frontend things are described in:

If you have a question of any kind, just make an issue and describe your problem in details.

## Contribution

If you are interested in contributing to this project, please follow the [instructions here](CONTRIBUTING.md).

## Self-Promotion

Like datagrid?
Expand All @@ -201,6 +202,5 @@ Follow the repository on [GitHub](https://github.com/bogdan/datagrid).

Read [author blog](http://gusiev.com).


## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbogdan%2Fdatagrid.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbogdan%2Fdatagrid?ref=badge_large)
2 changes: 1 addition & 1 deletion datagrid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Gem::Specification.new do |s|
"source_code_uri" => s.homepage,
}

s.add_dependency "railties", ">= 6.0"
s.add_dependency "railties", ">= 6.1"
end

22 changes: 22 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

group :development do
gem "appraisal"
gem "bump"
gem "csv"
gem "nokogiri"
gem "pry-byebug"
gem "rspec"
gem "sequel"
gem "sqlite3", "~> 1.7.0"
gem "rails", "~> 6.1.0"

group :mongo do
gem "bson"
gem "mongoid", "~> 9.0"
end
end

gemspec path: "../"
22 changes: 22 additions & 0 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

group :development do
gem "appraisal"
gem "bump"
gem "csv"
gem "nokogiri"
gem "pry-byebug"
gem "rspec"
gem "sequel"
gem "sqlite3", "~> 1.7.0"
gem "rails", "~> 7.0.0"

group :mongo do
gem "bson"
gem "mongoid", "~> 9.0"
end
end

gemspec path: "../"
22 changes: 22 additions & 0 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

group :development do
gem "appraisal"
gem "bump"
gem "csv"
gem "nokogiri"
gem "pry-byebug"
gem "rspec"
gem "sequel"
gem "sqlite3", "~> 1.7.0"
gem "rails", "~> 7.1.0"

group :mongo do
gem "bson"
gem "mongoid", "~> 9.0"
end
end

gemspec path: "../"
22 changes: 22 additions & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

group :development do
gem "appraisal"
gem "bump"
gem "csv"
gem "nokogiri"
gem "pry-byebug"
gem "rspec"
gem "sequel"
gem "sqlite3", "~> 2.0.0"
gem "rails", "~> 7.2.0"

group :mongo do
gem "bson"
gem "mongoid", github: "mongodb/mongoid"
end
end

gemspec path: "../"

0 comments on commit 487e1de

Please sign in to comment.