Skip to content

Commit 6c894e5

Browse files
committed
Fix Rails matrix workflow
1 parent ede46c8 commit 6c894e5

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

.github/workflows/rubyonrails.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ on:
1313
jobs:
1414
rspec:
1515
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
ruby: ['3.4.4']
19+
rails: ['7.1.5.1', '7.2', '8.0']
20+
fail-fast: false
21+
continue-on-error: ${{ matrix.rails != '7.1.5.1' }}
22+
env:
23+
RAILS_ENV: test
24+
DATABASE_URL: "postgis://rails:password@localhost:5432/rails_test"
25+
ES_HOST: "http://localhost"
26+
RAILS_VERSION: ${{ matrix.rails }}
1627
services:
1728
postgres:
1829
image: postgis/postgis:latest
@@ -33,18 +44,21 @@ jobs:
3344
"discovery.type": single-node
3445
"bootstrap.memory_lock": true
3546
"ES_JAVA_OPTS": "-Xms512m -Xmx512m"
36-
env:
37-
RAILS_ENV: test
38-
DATABASE_URL: "postgis://rails:password@localhost:5432/rails_test"
39-
ES_HOST: "http://localhost"
4047
steps:
4148
- name: Checkout code
4249
uses: actions/checkout@v3
4350
# Add or replace dependency steps here
4451
- name: Install Ruby and gems
4552
uses: ruby/setup-ruby@v1
4653
with:
47-
bundler-cache: true
54+
ruby-version: ${{ matrix.ruby }}
55+
bundler-cache: ${{ matrix.rails == '7.1.5.1' }}
56+
- name: Update Rails
57+
if: matrix.rails != '7.1.5.1'
58+
run: |
59+
bundle config set deployment false
60+
bundle update rails --conservative
61+
bundle install
4862
# Add or replace database setup steps here
4963
- name: Set up database schema
5064
run: rm -f spec/dummy/tmp/pids/server.pid && cd ./spec/dummy && bundle exec rails db:schema:load

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ gem 'pundit-resources', '~> 1.1.4', github: 'better-together-org/pundit-resource
2727

2828
# Core Rails gem
2929
gem 'rack-protection'
30-
gem 'rails', '~> 7.1.3'
30+
gem 'rails', ENV.fetch('RAILS_VERSION', '7.1.5.1')
3131

3232
# Redis for ActionCable and background jobs
3333
gem 'redis', '~> 5.4'

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ PATH
5353
rack-attack
5454
rack-cors (>= 1.1.1, < 3.1.0)
5555
rack-mini-profiler
56-
rails (>= 5.2.2, < 7.2.0)
56+
rails (>= 7.1, < 8.1)
5757
reform-rails (~> 0.2.0)
5858
rswag (>= 2.3.1, < 2.17.0)
5959
ruby-openai
@@ -824,7 +824,7 @@ DEPENDENCIES
824824
pundit-resources (~> 1.1.4)!
825825
rack-mini-profiler
826826
rack-protection
827-
rails (~> 7.1.3)
827+
rails (= 7.1.5.1)
828828
rb-readline
829829
rbtrace
830830
redis (~> 5.4)

better_together.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Gem::Specification.new do |spec|
6161
spec.add_dependency 'rack-attack'
6262
spec.add_dependency 'rack-cors', '>= 1.1.1', '< 3.1.0'
6363
spec.add_dependency 'rack-mini-profiler'
64-
spec.add_dependency 'rails', '>= 5.2.2', '< 7.2.0'
64+
spec.add_dependency 'rails', '>= 7.1', '< 8.1'
6565
spec.add_dependency 'reform-rails', '~> 0.2.0'
6666
spec.add_dependency 'rswag', '>= 2.3.1', '< 2.17.0'
6767
spec.add_dependency 'ruby-openai'

0 commit comments

Comments
 (0)