Skip to content

restore no-mri rubies #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 1, 2023
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
67 changes: 67 additions & 0 deletions .github/workflows/ci_jruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: CI Jruby

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
rspec:
runs-on: ubuntu-latest
services:
mysql:
image: mysql/mysql-server
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: closure_tree_test
MYSQL_ROOT_HOST: '%'
postgres:
image: 'postgres'
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: closure_tree_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

strategy:
fail-fast: false
matrix:
rails:
- activerecord_7.0
- activerecord_6.1
adapter:
- 'sqlite3:///:memory:'
- mysql2://root:root@0/closure_tree_test
- postgres://closure_tree:closure_tree@0/closure_tree_test

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: jruby
bundler-cache: true
rubygems: latest
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
RAILS_ENV: test

- name: RSpec
env:
RAILS_VERSION: ${{ matrix.rails }}
DB_ADAPTER: ${{ matrix.adapter }}
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }}
run: bin/rake
70 changes: 70 additions & 0 deletions .github/workflows/ci_truffleruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: CI Truffleruby

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
rspec:
runs-on: ubuntu-latest
services:
mysql:
image: mysql/mysql-server
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: closure_tree_test
MYSQL_ROOT_HOST: '%'
postgres:
image: 'postgres'
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: closure_tree_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

strategy:
fail-fast: false
matrix:
ruby:
- truffleruby
rails:
- activerecord_7.0
- activerecord_6.1
- activerecord_6.0
adapter:
- 'sqlite3:///:memory:'
- mysql2://root:root@0/closure_tree_test
- postgres://closure_tree:closure_tree@0/closure_tree_test

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: truffleruby
bundler-cache: true
rubygems: latest
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
RAILS_ENV: test

- name: RSpec
env:
RAILS_VERSION: ${{ matrix.rails }}
DB_ADAPTER: ${{ matrix.adapter }}
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }}
run: bin/rake
31 changes: 13 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,18 @@ RSpec::Core::RakeTask.new(:spec) do |task|
task.pattern = 'spec/closure_tree/*_spec.rb'
end

task default: [:spec, :test]
task default: %i[spec test]

namespace :spec do
desc 'Run all spec variants'
task :all do
rake = 'bin/rake'
fail unless system("#{rake} spec:generators")

[['', ''], ['db_prefix_', ''], ['', '_db_suffix'], ['abc_', '_123']].each do |prefix, suffix|
[['', ''], ['db_prefix_', ''], ['', '_db_suffix'], %w[abc_ _123]].each do |prefix, suffix|
env = "DB_PREFIX=#{prefix} DB_SUFFIX=#{suffix}"
fail unless system("#{rake} spec #{env}")
raise unless system("#{rake} spec #{env}")
end
end

desc 'Run generator specs'
RSpec::Core::RakeTask.new(:generators) do |task|
task.pattern = 'spec/generators/*_spec.rb'
end
end

Rake::TestTask.new do |t|
Expand All @@ -35,13 +29,14 @@ Rake::TestTask.new do |t|
t.verbose = true
end

require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.user = 'ClosureTree'
config.project = 'closure_tree'
config.issues = false
config.future_release = '5.2.0'
config.since_tag = 'v7.4.0'
if RUBY_ENGINE == 'ruby'
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.user = 'ClosureTree'
config.project = 'closure_tree'
config.issues = false
config.future_release = '5.2.0'
config.since_tag = 'v7.4.0'
end
end

task :default => "spec:all"
task default: 'spec:all'
9 changes: 7 additions & 2 deletions gemfiles/activerecord_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

source "https://rubygems.org"

gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
gem "activerecord", "~> 6.0.0"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end

platforms :ruby do
gem "mysql2"
gem "pg"
Expand Down
9 changes: 7 additions & 2 deletions gemfiles/activerecord_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

source "https://rubygems.org"

gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
gem "activerecord", "~> 6.1.0"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end

platforms :ruby do
gem "mysql2"
gem "pg"
Expand Down
9 changes: 7 additions & 2 deletions gemfiles/activerecord_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

source "https://rubygems.org"

gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
gem "activerecord", "~> 7.0.0"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end

platforms :ruby do
gem "mysql2"
gem "pg"
Expand Down
9 changes: 7 additions & 2 deletions gemfiles/activerecord_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

source "https://rubygems.org"

gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
gem "activerecord", github: "rails/rails"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end

platforms :ruby do
gem "mysql2"
gem "pg"
Expand Down
9 changes: 6 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require 'simplecov'

require 'database_cleaner'
require 'closure_tree/test/matcher'
require 'tmpdir'
Expand All @@ -13,8 +13,11 @@


# Start Simplecov
SimpleCov.start do
add_filter 'spec/'
if RUBY_ENGINE == 'ruby'
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
end

ActiveRecord::Base.configurations = {
Expand Down