Skip to content

Commit

Permalink
Merge pull request #243 from moneyadviceservice/ruby-upgrade
Browse files Browse the repository at this point in the history
Upgrade Ruby to 2.7.7
  • Loading branch information
benlovell committed Feb 1, 2024
2 parents b7e52e6 + d3b82c1 commit 351b5d0
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 187 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on: push

jobs:
test:
name: Run tests

runs-on: ubuntu-latest
env:
RAILS_ENV: test

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler: 1.17.2
bundler-cache: true

- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: '14.x'

- name: Install bower
run: npm install -g bower

- name: Install bowndler packages
run: bundle exec bowndler install && bundle exec bowndler update

- name: Run npm install
run: npm install

- name: Run cucumber tests
run: bundle exec cucumber

- name: Run tests
run: bundle exec rspec
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.3
2.7.7
13 changes: 7 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
source 'https://rubygems.org'
source 'http://gems.dev.mas.local'

# force Bundler to use SSL
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Declare your gem's dependencies in wpcc.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

ruby '2.5.3'
ruby IO.read('.ruby-version').chomp

gem 'bigdecimal', '1.3.5'
gem 'bowndler'
gem 'dough-ruby', github: 'moneyadviceservice/dough', branch: 'PostMessages_v5.45'
gem 'rails', '~> 4.2.7'
gem 'rubocop', '~> 0.63.1', require: false
gem 'sass-rails'
Expand All @@ -27,13 +31,10 @@ group :development, :test do
end

group :test do
gem 'brakeman', '~> 4.5.1', require: false
gem 'capybara', '< 3.0'
gem 'cucumber-rails', require: false
gem 'danger', require: false
gem 'danger-rubocop', require: false
gem 'poltergeist'
gem 'simplecov', require: false
gem 'phantomjs', require: 'phantomjs/poltergeist'
gem 'site_prism'
gem 'timecop'
gem 'tzinfo-data'
Expand Down
48 changes: 0 additions & 48 deletions Jenkinsfile

This file was deleted.

15 changes: 0 additions & 15 deletions docker-compose.yml

This file was deleted.

3 changes: 0 additions & 3 deletions hooks/pre-push

This file was deleted.

1 change: 0 additions & 1 deletion jenkins/Dangerfile

This file was deleted.

9 changes: 0 additions & 9 deletions jenkins/Dockerfile

This file was deleted.

31 changes: 0 additions & 31 deletions jenkins/build

This file was deleted.

47 changes: 0 additions & 47 deletions jenkins/test

This file was deleted.

4 changes: 2 additions & 2 deletions lib/wpcc/version.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Wpcc
module Version
MAJOR = 3
MINOR = 1
PATCH = 1
MINOR = 2
PATCH = 0

STRING = [MAJOR, MINOR, PATCH].join('.')
end
Expand Down
28 changes: 21 additions & 7 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
require File.expand_path('dummy/config/environment', __dir__)
abort('Do not run the tests in production mode!!!') if Rails.env.production?
require 'rspec/rails'
require 'simplecov'

Dir[
::Wpcc::Engine.root.join('spec/shared_examples/**.rb')
].each { |f| require f }

SimpleCov.start do
add_filter '/spec/'
end

SimpleCov.minimum_coverage 85

RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"

Expand All @@ -31,3 +24,24 @@
with.library :rails
end
end

# a workaround to avoid MonitorMixin double-initialize error
# https://github.com/rails/rails/issues/34790#issuecomment-681034561
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6.0')
if Gem::Version.new(Rails.version) < Gem::Version.new('5.0.0')
class ActionController::TestResponse < ActionDispatch::TestResponse
def recycle!
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
@mon_data = nil
@mon_data_owner_object_id = nil
else
@mon_mutex = nil
@mon_mutex_owner_object_id = nil
end
initialize
end
end
else
warn "Monkeypatch for ActionController::TestResponse is no longer needed"
end
end
16 changes: 0 additions & 16 deletions test.sh

This file was deleted.

2 changes: 1 addition & 1 deletion wpcc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|

s.test_files = Dir['spec/**/*']

s.add_dependency 'dough-ruby', '~> 5.38'
s.add_dependency 'dough-ruby', '< 6'
s.add_dependency 'meta-tags'
s.add_runtime_dependency 'modernizr-rails', '~> 2.6.2'

Expand Down

0 comments on commit 351b5d0

Please sign in to comment.