Skip to content

Commit

Permalink
Add MySQL to CI workflow (#1370)
Browse files Browse the repository at this point in the history
* [Gemfile] Add MySQL to Gemfile, for testing

* [CI] Add MySQL to CI workflow
  • Loading branch information
karlwilbur authored Jan 16, 2023
1 parent 413f46a commit 7297511
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ jobs:
tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres
env:
Expand All @@ -35,6 +47,7 @@ jobs:
- 5.2.4.4
- 5.1.7
database_url:
- mysql2://root:[email protected]:3306/test
- postgresql://postgres:password@localhost:5432/test
- sqlite3:test_db
exclude:
Expand All @@ -59,4 +72,4 @@ jobs:
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rake test
run: bundle exec rake test
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ version = ENV['RAILS_VERSION'] || 'default'

platforms :ruby do
gem 'pg'
gem 'mysql2'

if version.start_with?('4.2', '5.0')
gem 'sqlite3', '~> 1.3.13'
Expand All @@ -26,4 +27,4 @@ when 'default'
gem 'railties', '>= 6.0'
else
gem 'railties', "~> #{version}"
end
end

0 comments on commit 7297511

Please sign in to comment.