Skip to content

Commit

Permalink
Update test config to work on Rails 6.0 and 6.1
Browse files Browse the repository at this point in the history
This is purely for Centah. We use github actions so it adds a workflow for that instead of using travis

I don't know what phare is but that's gone.

I kept using the appraisals gem.
  • Loading branch information
Skipants committed Sep 4, 2024
1 parent 0c96b0a commit 5f83c34
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 153 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
pull_request:
branches: ['**']

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- 2.7.5
- 3.1.6
rails:
- 6.0
- 6.1
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
name: Ruby ${{ matrix.ruby }} Rails ${{ matrix.rails }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler: default
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
rubygems: latest
- name: Install dependencies
run: "bundle install --jobs 4 --retry 3"
- name: Run tests
run: "bundle exec rspec"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
/spec/dummy/tmp/
*.orig
.ruby-version
/gemfiles/*.gemfile.lock
tags

*.sqlite3
*.log
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

52 changes: 15 additions & 37 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,47 +1,25 @@
appraise 'rails-4-2 pundit-1' do
gem 'rails', '4.2.0'
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 1.0'
end
appraise 'rails-6-pundit-2' do
# Rails gems
gem 'rails', '~> 6.0.6', '>= 6.0.6.1'
gem 'puma', '~> 4.1'
gem 'bootsnap', '>= 1.4.2', require: false

appraise 'rails-5-0 pundit-1' do
gem 'rails', '5.0.0'
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 1.0'
end
# Fix for Rails not working well with Psych
gem 'psych', '< 4'

appraise 'rails-5-1 pundit-1' do
gem "rails", "5.1.0"
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 1.0'
end

appraise 'rails-5-2 pundit-1' do
gem 'rails', '5.2.0'
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 1.0'
end

appraise 'rails-4-2 pundit-2' do
gem 'rails', '4.2.0'
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 2.0'
end

appraise 'rails-5-0 pundit-2' do
gem 'rails', '5.0.0'
# jsonapi-authorization gems
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 2.0'
end

appraise 'rails-5-1 pundit-2' do
gem 'rails', '5.1.0'
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 2.0'
end
appraise 'rails-6.1-pundit-2' do
# Rails gems
gem 'rails', '~> 6.1.7', '>= 6.1.7.8'
gem 'puma', '~> 5.0'
gem 'sass-rails', '>= 6'
gem 'bcrypt', '~> 3.1.7'

appraise 'rails-5-2 pundit-2' do
gem 'rails', '5.2.0'
# jsonapi-authorization gems
gem 'jsonapi-resources', '~> 0.9'
gem 'pundit', '~> 2.0'
end
3 changes: 0 additions & 3 deletions Gemfile

This file was deleted.

17 changes: 0 additions & 17 deletions bin/phare

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails_4_2_pundit_1.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails_5_0_pundit_1.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails_5_0_pundit_2.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails_5_1_pundit_1.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails_5_1_pundit_2.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails_5_2_pundit_1.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails_5_2_pundit_2.gemfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "4.2.0"
gem "rails", "~> 6.1.7", ">= 6.1.7.8"
gem "puma", "~> 5.0"
gem "sass-rails", ">= 6"
gem "bcrypt", "~> 3.1.7"
gem "jsonapi-resources", "~> 0.9"
gem "pundit", "~> 2.0"

Expand Down
10 changes: 10 additions & 0 deletions gemfiles/rails_6.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source "https://rubygems.org"

gem "rails", "~> 6.0.6", ">= 6.0.6.1"
gem "puma", "~> 4.1"
gem "bootsnap", ">= 1.4.2", require: false
gem "psych", "< 4"
gem "jsonapi-resources", "~> 0.9"
gem "pundit", "~> 2.0"

gemspec path: "../"
13 changes: 7 additions & 6 deletions jsonapi-authorization.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ Gem::Specification.new do |spec|

spec.add_dependency "jsonapi-resources", "~> 0.9"
spec.add_dependency "pundit", ">= 1.0.0", "< 3.0.0"
spec.add_dependency "mutex_m"
spec.add_dependency "base64"

spec.add_development_dependency "appraisal"
spec.add_development_dependency "bundler", "~> 1.11"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rspec", "~> 3.8"
spec.add_development_dependency "rspec-rails", "~> 3.8"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rspec-rails"
spec.add_development_dependency "pry"
spec.add_development_dependency "pry-byebug"
spec.add_development_dependency "pry-doc"
spec.add_development_dependency "pry-rails"
spec.add_development_dependency "rubocop", "~> 0.36.0"
spec.add_development_dependency "phare", "~> 0.7.1"
spec.add_development_dependency "sqlite3", "~> 1.3.6"
spec.add_development_dependency "sqlite3", "~> 1.4"
end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
ENV["RAILS_ENV"] = "test"

require File.expand_path("../dummy/config/environment.rb", __FILE__)
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../dummy/db/migrate", __FILE__)]

ActiveRecord::Migration.maintain_test_schema!

Expand Down

0 comments on commit 5f83c34

Please sign in to comment.