Skip to content

Commit 342e914

Browse files
committed
test: Update Appraisal dependencies
1 parent 8359549 commit 342e914

13 files changed

+485
-428
lines changed

.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', '3.2']
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', '~> 1.4'] : ['sqlite3']
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'

extra/development.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
## Development
22

3+
- To update the Appraisal dependencies:
4+
5+
```sh
6+
RUBY=3.2 make up
7+
make appraisal_update
8+
9+
RUBY=3.0 make up
10+
make appraisal_update
11+
# (the last command will fail with the incompatible configurations)
12+
```
13+
14+
### Dev setup
15+
316
There 3 ways to interact with this project:
417

518
1) Using Docker:

0 commit comments

Comments
 (0)