Skip to content

Commit 2daad10

Browse files
committed
test: Update Appraisal dependencies
1 parent 12cb2ab commit 2daad10

File tree

7 files changed

+66
-31
lines changed

7 files changed

+66
-31
lines changed

.github/workflows/linters.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ 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

.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
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Specs Rails 7.0 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: 7.0.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_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

Gemfile

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,27 @@
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+
sqlite3 = Gem::Version.new(rails_ver) > Gem::Version.new('7.1') ? ['sqlite3'] : ['sqlite3', '~> 1.4']
22+
gem *sqlite3
23+
24+
# NOTE: to avoid error: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
25+
gem 'concurrent-ruby', '1.3.4'
26+
3427
gem 'bigdecimal'
3528
gem 'mutex_m'
3629
gem 'puma'

0 commit comments

Comments
 (0)