Skip to content

Commit

Permalink
Merge pull request #133 from tomascco/chore/update-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
serradura authored Nov 8, 2023
2 parents 744685d + f0e09f8 commit ecd33c9
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 145 deletions.
71 changes: 57 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,70 @@

name: build
name: Test
on: [push, pull_request]
jobs:
test:
name: "Ruby ${{ matrix.ruby }} - Rails ${{ matrix.rails }} - Transitions: ${{ matrix.transitions }}"
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 3.0, 3.1]
ruby: [2.7, 3.0, 3.1, 3.2, head]
rails: ["6.1", "7.0", "7.1", "edge"]
transitions: ["true", "false"]
include:
- ruby: 2.5
rails: "5.2"
transitions: true
- ruby: 2.5
rails: "6.0"
transitions: true
- ruby: 2.5
rails: "6.1"
transitions: true
- ruby: 2.6
rails: "5.2"
transitions: true
- ruby: 2.6
rails: "6.0"
transitions: true
- ruby: 2.6
rails: "6.1"
transitions: true
- ruby: 2.5
rails: "5.2"
transitions: false
- ruby: 2.5
rails: "6.0"
transitions: false
- ruby: 2.5
rails: "6.1"
transitions: false
- ruby: 2.6
rails: "5.2"
transitions: false
- ruby: 2.6
rails: "6.0"
transitions: false
- ruby: 2.6
rails: "6.1"
transitions: false
- ruby: 2.7
rails: "6.0"
transitions: true
- ruby: 2.7
rails: "6.0"
transitions: false
env:
BUNDLE_GEMFILE: "gemfiles/rails_${{ matrix.rails }}/Gemfile"
ENABLE_TRANSITIONS: ${{ matrix.transitions }}
ACTIVERECORD_VERSION: ${{ matrix.rails }}
CC_TEST_REPORTER_ID: 0377ece62be9c7042557d76e4e38b867e51c51b2a42d10ef5102b613ac077eab
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Test and generate coverage
run: bin/test
- name: Format coverage
if: ${{ matrix.ruby >= 3 }}
run: bin/prepare_coverage
- uses: paambaati/[email protected]
if: ${{ matrix.ruby >= 3 }}
env:
CC_TEST_REPORTER_ID: 0377ece62be9c7042557d76e4e38b867e51c51b2a42d10ef5102b613ac077eab
with:
debug: true
coverageLocations: coverage/.resultset.json:simplecov
run: bundle exec rake test
- uses: paambaati/codeclimate-action@v5
if: ${{ matrix.ruby == 3.2 && matrix.rails == '7.1' && matrix.transitions == 'true' }}
59 changes: 8 additions & 51 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,22 @@ source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

activerecord_version = ENV.fetch('ACTIVERECORD_VERSION', '7')

activerecord =
case activerecord_version
when '3.2' then '3.2.22'
when '4.0' then '4.0.13'
when '4.1' then '4.1.16'
when '4.2' then '4.2.11'
when '5.0' then '5.0.7'
when '5.1' then '5.1.7'
when '5.2' then '5.2.4'
when '6.0' then '6.0.3.4'
when '6.1' then '6.1.2'
end

simplecov_version =
case RUBY_VERSION
when /\A2.[23]/ then '~> 0.17.1'
when /\A2.4/ then '~> 0.18.5'
else '~> 0.21.2'
end

group :test do
gem 'minitest', activerecord_version < '4.1' ? '~> 4.2' : '~> 5.0'
gem 'minitest'

gem 'simplecov', simplecov_version, require: false
gem 'simplecov', require: false

if activerecord
sqlite3 =
case activerecord
when /\A6\.(0|1)/, nil then '~> 1.4.0'
else '~> 1.3.0'
end

gem 'sqlite3', sqlite3
gem 'activerecord', activerecord, require: 'active_record'
end
gem 'sqlite3'
gem 'activerecord', require: 'active_record'
end

pry_byebug_version =
case RUBY_VERSION
when /\A2.[23]/ then '3.6'
else '3.9'
end

pry_version =
case RUBY_VERSION
when /\A2.2/ then '0.12.2'
when /\A2.3/ then '0.12.2'
else '0.13.1'
end

group :development, :test do
gem 'awesome_print', '~> 1.8'
gem 'awesome_print'

gem 'byebug', '~> 10.0', '>= 10.0.2' if RUBY_VERSION =~ /\A2.[23]/
gem 'byebug'

gem 'pry', "~> #{pry_version}"
gem 'pry-byebug', "~> #{pry_byebug_version}"
gem 'pry'
gem 'pry-byebug'
end

# Specify your gem's dependencies in u-case.gemspec
Expand Down
27 changes: 0 additions & 27 deletions bin/prepare_coverage

This file was deleted.

53 changes: 0 additions & 53 deletions bin/test

This file was deleted.

24 changes: 24 additions & 0 deletions gemfiles/rails_5.2/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

group :test do
gem 'minitest'

gem 'simplecov', require: false

gem 'sqlite3'
gem 'activerecord', '~> 5.2.0', require: 'active_record'
end

group :development, :test do
gem 'awesome_print'

gem 'byebug'

gem 'pry'
gem 'pry-byebug'
end

# Specify your gem's dependencies in u-case.gemspec
gemspec path: "../.."
24 changes: 24 additions & 0 deletions gemfiles/rails_6.0/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

group :test do
gem 'minitest'

gem 'simplecov', require: false

gem 'sqlite3'
gem 'activerecord', '~> 6.0.0', require: 'active_record'
end

group :development, :test do
gem 'awesome_print'

gem 'byebug'

gem 'pry'
gem 'pry-byebug'
end

# Specify your gem's dependencies in u-case.gemspec
gemspec path: "../.."
24 changes: 24 additions & 0 deletions gemfiles/rails_6.1/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

group :test do
gem 'minitest'

gem 'simplecov', require: false

gem 'sqlite3'
gem 'activerecord', '~> 6.1.0', require: 'active_record'
end

group :development, :test do
gem 'awesome_print'

gem 'byebug'

gem 'pry'
gem 'pry-byebug'
end

# Specify your gem's dependencies in u-case.gemspec
gemspec path: "../.."
24 changes: 24 additions & 0 deletions gemfiles/rails_7.0/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

group :test do
gem 'minitest'

gem 'simplecov', require: false

gem 'sqlite3'
gem 'activerecord', '~> 7.0.0', require: 'active_record'
end

group :development, :test do
gem 'awesome_print'

gem 'byebug'

gem 'pry'
gem 'pry-byebug'
end

# Specify your gem's dependencies in u-case.gemspec
gemspec path: "../.."
24 changes: 24 additions & 0 deletions gemfiles/rails_7.1/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

group :test do
gem 'minitest'

gem 'simplecov', require: false

gem 'sqlite3'
gem 'activerecord', '~> 7.1.0', require: 'active_record'
end

group :development, :test do
gem 'awesome_print'

gem 'byebug'

gem 'pry'
gem 'pry-byebug'
end

# Specify your gem's dependencies in u-case.gemspec
gemspec path: "../.."
24 changes: 24 additions & 0 deletions gemfiles/rails_edge/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

group :test do
gem 'minitest'

gem 'simplecov', require: false

gem 'sqlite3'
gem 'activerecord', git: "https://github.com/rails/rails", branch: "main", require: 'active_record'
end

group :development, :test do
gem 'awesome_print'

gem 'byebug'

gem 'pry'
gem 'pry-byebug'
end

# Specify your gem's dependencies in u-case.gemspec
gemspec path: "../.."

0 comments on commit ecd33c9

Please sign in to comment.