Skip to content

Commit 9aa9a51

Browse files
authored
Merge pull request #36 from blocknotes/test/update-appraisal-dependencies
test: Replace Appraisal
2 parents 8359549 + 61fd17d commit 9aa9a51

25 files changed

+72
-2553
lines changed

.github/workflows/linters.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ jobs:
1212
name: Reviewdog
1313
runs-on: ubuntu-latest
1414

15+
env:
16+
RAILS_VERSION: 7.0.0
17+
1518
steps:
1619
- name: Checkout repository
1720
uses: actions/checkout@v4
1821

1922
- name: Set up Ruby
2023
uses: ruby/setup-ruby@v1
2124
with:
22-
ruby-version: '2.7'
25+
ruby-version: '3.0'
2326
bundler-cache: true
2427

2528
- name: Set up Reviewdog
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Specs Rails 6.1 with ActiveAdmin 2.9
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
ruby: ['3.0']
17+
18+
env:
19+
RAILS_VERSION: 6.0
20+
ACTIVEADMIN_VERSION: 2.9.0
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Ruby
27+
uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: ${{ matrix.ruby }}
30+
bundler-cache: true
31+
32+
- name: Database setup
33+
run: bin/rails db:reset db:test:prepare
34+
35+
- name: Run tests
36+
run: bundle exec rspec --profile
37+
38+
- name: On failure, archive screenshots as artifacts
39+
uses: actions/upload-artifact@v4
40+
if: failure()
41+
with:
42+
name: test-failed-screenshots
43+
path: spec/dummy/tmp/screenshots

.github/workflows/specs_rails70.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ jobs:
1414
strategy:
1515
matrix:
1616
ruby: ['3.0', '3.2']
17-
gemfile: ['rails70_activeadmin']
1817

1918
env:
20-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
19+
RAILS_VERSION: 7.0.0
2120

2221
steps:
2322
- name: Checkout repository

.github/workflows/specs_rails71.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ jobs:
1414
strategy:
1515
matrix:
1616
ruby: ['3.2', '3.4']
17-
gemfile: ['rails71_activeadmin']
1817

1918
env:
20-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
19+
RAILS_VERSION: 7.1.0
2120

2221
steps:
2322
- name: Checkout repository

.github/workflows/specs_rails72.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ jobs:
1414
strategy:
1515
matrix:
1616
ruby: ['3.2', '3.4']
17-
gemfile: ['rails72_activeadmin']
1817

1918
env:
20-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
19+
RAILS_VERSION: 7.2.0
2120

2221
steps:
2322
- name: Checkout repository

.github/workflows/specs_rails80.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ jobs:
1414
strategy:
1515
matrix:
1616
ruby: ['3.2', '3.4']
17-
gemfile: ['rails80_activeadmin']
1817

1918
env:
20-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
19+
RAILS_VERSION: 8.0.0
2120

2221
steps:
2322
- name: Checkout repository

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require:
99
- rubocop-rspec
1010

1111
AllCops:
12+
TargetRubyVersion: 3.0
1213
Exclude:
1314
- bin/*
1415
- db/schema.rb

Appraisals

Lines changed: 0 additions & 46 deletions
This file was deleted.

Gemfile

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,29 @@
33
source 'https://rubygems.org'
44

55
if ENV['DEVEL'] == '1'
6-
rails_ver = ENV.fetch('RAILS_VERSION', '')
7-
activeadmin_ver = ENV.fetch('ACTIVEADMIN_VERSION', '')
8-
9-
if rails_ver.empty?
10-
gem 'rails'
11-
else
12-
gem 'rails', "~> #{rails_ver}"
13-
end
14-
15-
if activeadmin_ver.empty?
16-
gem 'activeadmin'
17-
else
18-
gem 'activeadmin', "~> #{activeadmin_ver}"
19-
end
20-
216
gem 'activeadmin_dynamic_fields', path: './'
22-
gem 'appraisal', '~> 2.4'
23-
24-
if rails_ver.start_with?('7.0')
25-
gem 'concurrent-ruby', '1.3.4'
26-
gem 'sqlite3', '~> 1.4'
27-
else
28-
gem 'sqlite3'
29-
end
307
else
318
gemspec
329
end
3310

11+
ruby_ver = ENV.fetch('RUBY_VERSION', '')
12+
rails_ver = ENV.fetch('RAILS_VERSION', '')
13+
activeadmin_ver = ENV.fetch('ACTIVEADMIN_VERSION', '')
14+
15+
rails = rails_ver.empty? ? ['rails'] : ['rails', "~> #{rails_ver}"]
16+
gem(*rails)
17+
18+
activeadmin = activeadmin_ver.empty? ? ['activeadmin'] : ['activeadmin', "~> #{activeadmin_ver}"]
19+
gem(*activeadmin)
20+
21+
ruby32 = Gem::Version.new(ruby_ver) >= Gem::Version.new('3.2')
22+
rails72 = Gem::Version.new(rails_ver) >= Gem::Version.new('7.2')
23+
sqlite3 = ruby32 || rails72 ? ['sqlite3'] : ['sqlite3', '~> 1.4']
24+
gem(*sqlite3)
25+
26+
# NOTE: to avoid error: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
27+
gem 'concurrent-ruby', '1.3.4'
28+
3429
gem 'bigdecimal'
3530
gem 'mutex_m'
3631
gem 'puma'

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,5 @@ specs:
2626
lint:
2727
@docker compose -f extra/docker-compose.yml exec app bin/rubocop
2828

29-
appraisal_update:
30-
@docker compose -f extra/docker-compose.yml exec app bin/appraisal update
31-
3229
shell:
3330
@docker compose -f extra/docker-compose.yml exec app bash

0 commit comments

Comments
 (0)