Skip to content

Commit

Permalink
Merge pull request #2018 from newrelic/mysql2_rails4
Browse files Browse the repository at this point in the history
CI fix: Rails40 and Rails41
  • Loading branch information
hannahramadan authored May 17, 2023
2 parents 3f82a0d + 0f98b97 commit 1908835
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
}
- if: matrix.ruby-version == '2.4.10'
name: Prepare mysql dirextory
name: Prepare mysql directory
run: sudo chown -R $USER /usr/local

- if: matrix.ruby-version == '2.4.10'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
}
- if: matrix.ruby-version == '2.4.10' || matrix.ruby-version == '2.5.9' || matrix.ruby-version == '2.6.10'
name: Prepare mysql dirextory
name: Prepare mysql directory
run: sudo chown -R $USER /usr/local

- if: matrix.ruby-version == '2.4.10' || matrix.ruby-version == '2.5.9' || matrix.ruby-version == '2.6.10'
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/scripts/setup_bundler
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ function install_desired_bundler_version {
gem list bundler
}

function configure_bundler {
if ! [[ $RUBY_VERSION =~ 2.4 ]]; then
echo "DEBUG: Ruby is not at version 2.4.x, skipping 'bundler config'"
return
fi

# add mysql specific config for bundler when we are using older mysql
echo "DEBUG: running 'bundle config'"
bundle config --global build.mysql2 --with-mysql-config=/usr/local/mysql55/bin/mysql_config
}

function install_ruby_version_specific_gems {
if using_jruby; then
echo "DEBUG: Skipping specific gem installation, as JRuby is in use"
Expand Down Expand Up @@ -90,6 +101,7 @@ function set_up_bundler {

update_to_desired_rubygems_version
install_desired_bundler_version
configure_bundler
}

echo "DEBUG: setting up Bundler"
Expand Down
2 changes: 1 addition & 1 deletion test/environments/rails40/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

gem 'rake', '~> 12.3.3'
gem 'rake', '10.0.4'
gem 'rails', '~> 4.0.0'

gem 'minitest', '4.7.5', require: false # Minitest ~> 4.2 required for Rails 3.2
Expand Down
2 changes: 1 addition & 1 deletion test/environments/rails41/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

gem 'rake', '~> 12.3.3'
gem 'rake', '10.0.4'
gem 'rails', '~> 4.1.0'

gem 'minitest', '5.2.3'
Expand Down

0 comments on commit 1908835

Please sign in to comment.