Skip to content

Commit

Permalink
fix testing matrix (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros authored Jun 27, 2023
1 parent 33a5d17 commit a90abb2
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 97 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/engines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Exotic Ruby

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['jruby', 'truffleruby']
gemfiles:
- gemfiles/active_record_6.0.gemfile
- gemfiles/active_record_6.1.gemfile
- gemfiles/active_record_7.0.gemfile
- gemfiles/active_record_edge.gemfile
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfiles }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
continue-on-error: true
40 changes: 5 additions & 35 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby

on:
Expand All @@ -18,43 +11,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', 'jruby']
gemfiles:
- gemfiles/active_record_5.1.gemfile
- gemfiles/active_record_5.2.gemfile
ruby-version: ['3.0', '3.1', '3.2']
gemfiles:
- gemfiles/active_record_6.0.gemfile
- gemfiles/active_record_6.1.gemfile
- gemfiles/active_record_7.0.gemfile
- gemfiles/active_record_edge.gemfile
exclude:
- ruby-version: '2.6'
gemfiles: gemfiles/active_record_7.0.gemfile
- ruby-version: '2.6'
gemfiles: gemfiles/active_record_edge.gemfile
- ruby-version: '3.0'
gemfiles: gemfiles/active_record_5.1.gemfile
- ruby-version: '3.0'
gemfiles: gemfiles/active_record_5.2.gemfile
- ruby-version: '3.1'
gemfiles: gemfiles/active_record_5.1.gemfile
- ruby-version: '3.1'
gemfiles: gemfiles/active_record_5.2.gemfile
- ruby-version: '3.2'
gemfiles: gemfiles/active_record_5.1.gemfile
- ruby-version: '3.2'
gemfiles: gemfiles/active_record_5.2.gemfile
- ruby-version: 'jruby'
gemfiles: gemfiles/active_record_7.0.gemfile
- ruby-version: 'jruby'
gemfiles: gemfiles/active_record_edge.gemfile
env:
BUNDLE_GEMFILE: ${{ matrix.gemfiles }}
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfiles }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run Tests
- name: Run tests
run: bundle exec rake
18 changes: 3 additions & 15 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
appraise "active_record_5.1" do
gem "sqlite3", platforms: [:mri, :rbx]
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby]
gem "activerecord", '~> 5.1.1'
end

appraise "active_record_5.2" do
gem "sqlite3", platforms: [:mri, :rbx]
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby]
gem "activerecord", '~> 5.2.4'
end

appraise 'active_record_6.0' do
gem "sqlite3", platforms: [:mri, :rbx]
gem "sqlite3", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby]
gem "activerecord", '~> 6.0.3'
end

appraise 'active_record_6.1' do
gem "sqlite3", platforms: [:mri, :rbx]
gem "sqlite3", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby]
gem "activerecord", '~> 6.1.3'
end
Expand All @@ -29,7 +17,7 @@ appraise 'active_record_7.0' do
end

appraise "active_record_edge" do
gem "sqlite3", platforms: [:mri, :rbx]
gem "sqlite3", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby]
gem "activerecord", github: 'rails/rails', branch: 'main'
gem "activemodel", github: 'rails/rails', branch: 'main'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 2006-2012 Aaron Pfeifer
Copyright (c) 2014-2021 Abdelkader Boudih
Copyright (c) 2014-2023 Abdelkader Boudih

MIT License

Expand Down
13 changes: 0 additions & 13 deletions gemfiles/active_record_5.1.gemfile

This file was deleted.

13 changes: 0 additions & 13 deletions gemfiles/active_record_5.2.gemfile

This file was deleted.

13 changes: 5 additions & 8 deletions state_machines-activerecord.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'state_machines/integrations/active_record/version'
require_relative 'lib/state_machines/integrations/active_record/version'

Gem::Specification.new do |spec|
spec.name = 'state_machines-activerecord'
Expand All @@ -13,13 +10,13 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://github.com/state-machines/state_machines-activerecord/'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0")
spec.test_files = spec.files.grep(/^test\//)
spec.required_ruby_version = '>= 2.2.2'
spec.files = Dir['{lib}/**/*', 'LICENSE.txt', 'README.md']
spec.test_files = Dir['test/**/*']
spec.required_ruby_version = '>= 3.0'
spec.require_paths = ['lib']

spec.add_dependency 'state_machines-activemodel', '>= 0.8.0'
spec.add_dependency 'activerecord' , '>= 5.1'
spec.add_dependency 'activerecord' , '>= 6.0'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'sqlite3', '~> 1.3'
spec.add_development_dependency 'appraisal', '>= 1'
Expand Down
14 changes: 2 additions & 12 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
# Establish database connection
ActiveRecord::Base.establish_connection('adapter' => 'sqlite3', 'database' => ':memory:')
ActiveRecord::Base.logger = Logger.new("#{File.dirname(__FILE__)}/../log/active_record.log")

if ActiveSupport.gem_version >= Gem::Version.new('4.2.0')
ActiveSupport.test_order = :random
if ActiveSupport.gem_version < Gem::Version.new('5.1.x')
ActiveRecord::Base.raise_in_transactional_callbacks = true
end
end
ActiveSupport.test_order = :random

class BaseTestCase < ActiveSupport::TestCase
protected
Expand All @@ -31,11 +25,7 @@ def new_model(create_table = :foo, &block)
connection.create_table(table_name, :force => true) { |t| t.string(:state) } if create_table

define_method(:abort_from_callback) do
if ActiveSupport.gem_version >= Gem::Version.new('5.0')
throw :abort
else
false
end
throw :abort
end

(
Expand Down

0 comments on commit a90abb2

Please sign in to comment.