Skip to content

Commit

Permalink
Merge pull request #848 from varvet/kbs/adjust-ci-on-main
Browse files Browse the repository at this point in the history
Fix CI for JRuby broken on main due to outside influence
  • Loading branch information
Burgestrand authored Feb 21, 2025
2 parents a82833b + 33644b7 commit d60d6f4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- "3.1"
- "3.2"
- "3.3"
- "jruby-9.3.10" # oldest supported jruby
- "jruby-9.3.15"
- "jruby"
include: # HEAD-versions
- ruby-version: "head"
Expand All @@ -47,12 +47,7 @@ jobs:
with:
rubygems: latest
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: ${{ !startsWith(matrix.ruby-version, 'jruby') }}
- name: Bundler install (JRuby workaround)
if: ${{ startsWith(matrix.ruby-version, 'jruby') }}
run: |
gem install psych
bundle install
bundler-cache: true
- name: Run tests
run: bundle exec rspec

Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ source "https://rubygems.org"

gemspec

# https://github.com/ruby/psych/issues/655
gem "psych", "!= 5.1.1", platforms: %i[jruby]
# Affects us on JRuby 9.3.15.
#
# @see https://github.com/rails/rails/issues/54260
gem "logger"
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
end
end

# @see https://github.com/rails/rails/issues/54260
require "logger" if RUBY_ENGINE == "jruby" && RUBY_ENGINE_VERSION.start_with?("9.3")

require "pundit"
require "pundit/rspec"
require "active_model/naming"
Expand Down
2 changes: 0 additions & 2 deletions spec/support/lib/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def #{method}(*args, **kwargs, &block)

include Pundit::Authorization
# Mark protected methods public so they may be called in test
# rubocop:disable Style/AccessModifierDeclarations
public(*Pundit::Authorization.protected_instance_methods)
# rubocop:enable Style/AccessModifierDeclarations

def initialize(current_user, action_name, params)
@current_user = current_user
Expand Down

0 comments on commit d60d6f4

Please sign in to comment.