-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiple versions of Rails and Ruby to tests
- Loading branch information
Showing
13 changed files
with
221 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,27 @@ jobs: | |
env: | ||
RAILS_ENV: test | ||
DATABASE_URL: postgres://test:[email protected]:5432/grape_on_rails_test | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile.file }}.gemfile | ||
continue-on-error: ${{ matrix.gemfile.experimental }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: | ||
- "2.7" | ||
- "3.0" | ||
- "3.1" | ||
- "3.2" | ||
gemfile: | ||
- { file: rails_6, experimental: false } | ||
- { file: rails_6_1, experimental: false } | ||
- { file: rails_7, experimental: false } | ||
- { file: rails_edge, experimental: true } | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.1.2" | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- name: Setup Firefox | ||
uses: browser-actions/setup-firefox@latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
appraise 'rails-6' do | ||
gem 'rails', '~> 6.0' | ||
end | ||
|
||
appraise 'rails-6-1' do | ||
gem 'rails', '~> 6.1' | ||
end | ||
|
||
appraise 'rails-7' do | ||
gem 'rails', '~> 7.0' | ||
end | ||
|
||
appraise 'rails-edge' do | ||
gem 'rails', github: 'rails/rails' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
Grape on Rails | ||
============== | ||
# Grape on Rails | ||
|
||
[](https://github.com/ruby-grape/grape-on-rails/actions/workflows/test.yml) | ||
[](https://github.com/ruby-grape/grape-on-rails/actions/workflows/test.yml) | ||
[](https://codeclimate.com/github/ruby-grape/grape-on-rails) | ||
|
||
A [Grape](http://github.com/ruby-grape/grape) API mounted on Rails. | ||
|
||
* [ping](app/api/acme/ping.rb): a hello world `GET` API | ||
* [post](app/api/acme/post.rb): post JSON data | ||
* [raise](app/api/acme/raise.rb): raise an error, Rails handling exceptions | ||
* [protected](app/api/acme/protected.rb): API protected with rudimentary Basic Authentication | ||
* [headers](app/api/acme/headers.rb): demonstrates header handling | ||
- [ping](app/api/acme/ping.rb): a hello world `GET` API | ||
- [post](app/api/acme/post.rb): post JSON data | ||
- [raise](app/api/acme/raise.rb): raise an error, Rails handling exceptions | ||
- [protected](app/api/acme/protected.rb): API protected with rudimentary Basic Authentication | ||
- [headers](app/api/acme/headers.rb): demonstrates header handling | ||
|
||
Run | ||
--- | ||
## Run | ||
|
||
``` | ||
bundle install | ||
rails s | ||
``` | ||
|
||
Try http://localhost:3000/api/ping or http://localhost:3000/api/protected/ping with _username_ and _password_. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
class ApplicationRecord < ActiveRecord::Base | ||
primary_abstract_class | ||
if Gem::Version.new(Rails.version) >= Gem::Version.new('7.0') | ||
primary_abstract_class | ||
else | ||
self.abstract_class = true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This file was generated by Appraisal | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'bootsnap', require: false | ||
gem 'grape', '~> 1.7' | ||
gem 'importmap-rails' | ||
gem 'jbuilder' | ||
gem 'pg', '~> 1.1' | ||
gem 'puma', '~> 5.0' | ||
gem 'rails', '~> 6.0' | ||
gem 'sprockets-rails' | ||
gem 'stimulus-rails' | ||
gem 'turbo-rails' | ||
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] | ||
|
||
group :development, :test do | ||
gem 'debug', platforms: %i[mri mingw x64_mingw] | ||
end | ||
|
||
group :development do | ||
gem 'appraisal' | ||
gem 'web-console' | ||
end | ||
|
||
group :test do | ||
gem 'capybara' | ||
gem 'rspec' | ||
gem 'rspec-rails' | ||
gem 'rubocop' | ||
gem 'selenium-webdriver' | ||
gem 'webdrivers' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This file was generated by Appraisal | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'bootsnap', require: false | ||
gem 'grape', '~> 1.7' | ||
gem 'importmap-rails' | ||
gem 'jbuilder' | ||
gem 'pg', '~> 1.1' | ||
gem 'puma', '~> 5.0' | ||
gem 'rails', '~> 6.1' | ||
gem 'sprockets-rails' | ||
gem 'stimulus-rails' | ||
gem 'turbo-rails' | ||
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] | ||
|
||
group :development, :test do | ||
gem 'debug', platforms: %i[mri mingw x64_mingw] | ||
end | ||
|
||
group :development do | ||
gem 'appraisal' | ||
gem 'web-console' | ||
end | ||
|
||
group :test do | ||
gem 'capybara' | ||
gem 'rspec' | ||
gem 'rspec-rails' | ||
gem 'rubocop' | ||
gem 'selenium-webdriver' | ||
gem 'webdrivers' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This file was generated by Appraisal | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'bootsnap', require: false | ||
gem 'grape', '~> 1.7' | ||
gem 'importmap-rails' | ||
gem 'jbuilder' | ||
gem 'pg', '~> 1.1' | ||
gem 'puma', '~> 5.0' | ||
gem 'rails', '~> 7.0' | ||
gem 'sprockets-rails' | ||
gem 'stimulus-rails' | ||
gem 'turbo-rails' | ||
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] | ||
|
||
group :development, :test do | ||
gem 'debug', platforms: %i[mri mingw x64_mingw] | ||
end | ||
|
||
group :development do | ||
gem 'appraisal' | ||
gem 'web-console' | ||
end | ||
|
||
group :test do | ||
gem 'capybara' | ||
gem 'rspec' | ||
gem 'rspec-rails' | ||
gem 'rubocop' | ||
gem 'selenium-webdriver' | ||
gem 'webdrivers' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This file was generated by Appraisal | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'bootsnap', require: false | ||
gem 'grape', '~> 1.7' | ||
gem 'importmap-rails' | ||
gem 'jbuilder' | ||
gem 'pg', '~> 1.1' | ||
gem 'puma', '~> 5.0' | ||
gem 'rails', git: 'https://github.com/rails/rails.git' | ||
gem 'sprockets-rails' | ||
gem 'stimulus-rails' | ||
gem 'turbo-rails' | ||
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] | ||
|
||
group :development, :test do | ||
gem 'debug', platforms: %i[mri mingw x64_mingw] | ||
end | ||
|
||
group :development do | ||
gem 'appraisal' | ||
gem 'web-console' | ||
end | ||
|
||
group :test do | ||
gem 'capybara' | ||
gem 'rspec' | ||
gem 'rspec-rails' | ||
gem 'rubocop' | ||
gem 'selenium-webdriver' | ||
gem 'webdrivers' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters