Skip to content
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
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Tests

on: [push, pull_request]

jobs:
test:
name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby: [3.1, '3.0', 2.7, 2.6, ruby-head]
rails: ['7.0.0', '6.1.0', '6.0.0', '5.2.0', main]
exclude:
- ruby: ruby-head
rails: '6.1.0'
- ruby: ruby-head
rails: '6.0.0'
- ruby: ruby-head
rails: '5.2.0'
- ruby: 3.1
rails: '6.0.0'
- ruby: 3.1
rails: '5.2.0'
- ruby: 3.0
rails: main
- ruby: 3.0
rails: '6.0.0'
- ruby: 3.0
rails: '5.2.0'
- ruby: 2.7
rails: main
- ruby: 2.7
rails: '5.2.0'
- ruby: 2.6
rails: main
- ruby: 2.6
rails: '7.0.0'
- ruby: 2.6
rails: '6.1.0'
- ruby: 2.6
rails: '6.0.0'

env:
RAILS_VERSION: ${{ matrix.rails }}

steps:
- uses: actions/checkout@v2
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # 'bundle install' and cache
- name: Run tests
run: bundle exec rake
10 changes: 9 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
rails_version = ENV['RAILS_VERSION'] || "default"
rails =
case rails_version
when 'master'
when 'main'
{ github: 'rails/rails' }
when 'default'
'>= 5.0'
Expand All @@ -13,4 +13,12 @@ rails =

gem 'rails', rails

# Required for Rails 6.1.x with Ruby 3.1+
if RUBY_VERSION >= '3.1'
gem 'net-smtp', require: false
gem 'net-imap', require: false
gem 'net-pop', require: false
end


gemspec
7 changes: 3 additions & 4 deletions jsonapi-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ Gem::Specification.new do |spec|
spec.add_dependency 'jsonapi-rb', '~> 0.5.0'
spec.add_dependency 'jsonapi-parser', '~> 0.1.0'

spec.add_development_dependency 'rails', '~> 5.0'
spec.add_development_dependency 'sqlite3', '~> 1.3'
spec.add_development_dependency 'rake', '~> 11.3'
spec.add_development_dependency 'rails', '>= 5.0'
spec.add_development_dependency 'sqlite3', '>= 1.3'
spec.add_development_dependency 'rake', '>= 11.3'
spec.add_development_dependency 'rspec-rails', '~> 3.5'
spec.add_development_dependency 'with_model', '~> 2.0'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'pry-byebug'
end
2 changes: 1 addition & 1 deletion spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
config.cache_classes = false

# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
Expand Down
4 changes: 3 additions & 1 deletion spec/dummy/config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
if Rails.application.config.respond_to?(:assets)
Rails.application.config.assets.version = '1.0'
end

# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
Expand Down
8 changes: 8 additions & 0 deletions spec/dummy/config/storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>

local:
service: Disk
root: <%= Rails.root.join("storage") %>