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
79 changes: 28 additions & 51 deletions .github/workflows/super_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
all:
runs-on: ubuntu-latest
needs:
- lint
- audit
- test
outputs:
PASSED: ${{ steps.set-output.outputs.PASSED }}
steps:
- name: Set PASSED output
id: set-output
run: echo "PASSED=true" >> "$GITHUB_OUTPUT"
lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -25,71 +37,48 @@ jobs:
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install Ruby dependencies
run: bin/ci/install
- name: Install Yarn dependencies
run: yarn --immutable
- name: Lint
run: yarn lint
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install Ruby dependencies
run: bin/ci/install
- name: Install Yarn dependencies
run: yarn --immutable
- name: Audit
run: yarn audit
test:
needs:
- lint
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby:
- 2.5
- 2.6
- 2.7
- "3.0"
- "3.1"
- "3.2"
rails_appraisal:
- rails_5_0
- rails_5_1
- rails_5_2
- rails_6_0
- rails_6_1
- rails_7_0
- no_rails
rspec_appraisal:
- rspec_lt_3_10
- rspec_gte_3_10
exclude:
- rails_appraisal: rails_6_1
rspec_appraisal: rspec_lt_3_10

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
JAVA_OPTS: "--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.io=org.jruby.dist"
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bin/ci/run-tests
test_ruby_3:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install Yarn dependencies
run: yarn --immutable
- name: Audit
run: yarn audit
test:
needs:
- lint
- audit
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand All @@ -99,26 +88,14 @@ jobs:
- "3.1"
- "3.2"
rails_appraisal:
- rails_6_0
- rails_6_1
- rails_7_0
- no_rails
rspec_appraisal:
- rspec_lt_3_10
- rspec_gte_3_10
exclude:
- ruby: 3.2
rails_appraisal: rails_6_0
- ruby: 3.2
rails_appraisal: rails_6_1
- rails_appraisal: rails_6_1
rspec_appraisal: rspec_lt_3_10
- rails_appraisal: rails_7_0
rspec_appraisal: rspec_lt_3_10

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
JAVA_OPTS: "--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.io=org.jruby.dist"
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
Expand All @@ -127,4 +104,4 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bin/ci/run-tests
run: bundle exec rake --trace
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.2.1
69 changes: 8 additions & 61 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,10 @@ rails_dependencies =
proc do
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
install_if '-> { Gem::Requirement.new(">= 2.6.0").satisfied_by?(Gem::Version.new(RUBY_VERSION)) }' do
gem "net-ftp"
end
gem "net-ftp"
end

appraisals = {
rails_5_0:
proc do
instance_eval(&rails_dependencies)

gem "activerecord", "~> 5.0.0"
gem "railties", "~> 5.0.0"
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
end,
rails_5_1:
proc do
instance_eval(&rails_dependencies)

gem "activerecord", "~> 5.1.0"
gem "railties", "~> 5.1.0"
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
end,
rails_5_2:
proc do
instance_eval(&rails_dependencies)

gem "activerecord", "~> 5.2.0"
gem "railties", "~> 5.2.0"
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
end,
rails_6_0:
proc do
instance_eval(&rails_dependencies)
Expand Down Expand Up @@ -75,44 +49,17 @@ appraisals = {
end
}

rails_appraisals = [:no_rails]

if Gem::Requirement.new("< 3").satisfied_by?(Gem::Version.new(RUBY_VERSION))
rails_appraisals << :rails_5_0
rails_appraisals << :rails_5_1
rails_appraisals << :rails_5_2
end

if Gem::Requirement.new(">= 2.5.0").satisfied_by?(
Gem::Version.new(RUBY_VERSION)
)
rails_appraisals << :rails_6_0
rails_appraisals << :rails_6_1
end

if Gem::Requirement.new(">= 2.7.0").satisfied_by?(
Gem::Version.new(RUBY_VERSION)
)
rails_appraisals << :rails_7_0
end

rails_appraisals = %i[no_rails rails_6_0 rails_6_1 rails_7_0]
rspec_appraisals = %i[rspec_lt_3_10 rspec_gte_3_10]

rails_appraisals.each do |rails_appraisal|
rspec_appraisals.each do |rspec_appraisal|
if rails_appraisal == :no_rails
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
instance_eval(&appraisals.fetch(rails_appraisal))
instance_exec(false, &appraisals.fetch(rspec_appraisal))
end
elsif %i[rails_6_1 rails_7_0].include?(rails_appraisal) &&
rspec_appraisal == :rspec_lt_3_10
next
else
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
instance_eval(&appraisals.fetch(rails_appraisal))
instance_exec(true, &appraisals.fetch(rspec_appraisal))
end
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
instance_eval(&appraisals.fetch(rails_appraisal))
instance_exec(
rails_appraisal != :no_rails,
&appraisals.fetch(rspec_appraisal)
)
end
end
end
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ source "https://rubygems.org"

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

gem "appraisal",
github: "thoughtbot/appraisal",
ref: "2f5be65b8e127bd602fd149f395f2f8fa50616a8"
gem "appraisal", github: "thoughtbot/appraisal"
gem "bundler-audit"
gem "childprocess"
gem "climate_control"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ I'll get notified right away!
## Compatibility

`super_diff` is [tested][gh-actions] to work with
Ruby >= 2.5.x,
Ruby >= 3.x,
RSpec 3.x,
and Rails >= 5.x.
and Rails >= 6.x.

[gh-actions]: https://github.com/mcmire/super_diff/actions?query=workflow%3ASuperDiff

Expand Down
5 changes: 0 additions & 5 deletions bin/ci/install

This file was deleted.

3 changes: 0 additions & 3 deletions bin/ci/run-tests

This file was deleted.

3 changes: 2 additions & 1 deletion gemfiles/no_rails_rspec_gte_3_10.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

source "https://rubygems.org"

gem "appraisal", ref: "2f5be65b8e127bd602fd149f395f2f8fa50616a8", git: "https://github.com/thoughtbot/appraisal"
gem "appraisal", git: "https://github.com/thoughtbot/appraisal"
gem "bundler-audit"
gem "childprocess"
gem "climate_control"
gem "pry-byebug", platform: :mri
Expand Down
3 changes: 2 additions & 1 deletion gemfiles/no_rails_rspec_lt_3_10.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

source "https://rubygems.org"

gem "appraisal", ref: "2f5be65b8e127bd602fd149f395f2f8fa50616a8", git: "https://github.com/thoughtbot/appraisal"
gem "appraisal", git: "https://github.com/thoughtbot/appraisal"
gem "bundler-audit"
gem "childprocess"
gem "climate_control"
gem "pry-byebug", platform: :mri
Expand Down
28 changes: 0 additions & 28 deletions gemfiles/rails_5_0_rspec_gte_3_10.gemfile

This file was deleted.

28 changes: 0 additions & 28 deletions gemfiles/rails_5_0_rspec_lt_3_10.gemfile

This file was deleted.

28 changes: 0 additions & 28 deletions gemfiles/rails_5_1_rspec_gte_3_10.gemfile

This file was deleted.

Loading