Skip to content

Commit 7297511

Browse files
authored
Add MySQL to CI workflow (#1370)
* [Gemfile] Add MySQL to Gemfile, for testing * [CI] Add MySQL to CI workflow
1 parent 413f46a commit 7297511

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/ruby.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ jobs:
1010
tests:
1111
runs-on: ubuntu-latest
1212
services:
13+
mysql:
14+
image: mysql
15+
env:
16+
MYSQL_ROOT_PASSWORD: root
17+
MYSQL_DATABASE: test
18+
ports:
19+
- 3306:3306
20+
options: >-
21+
--health-cmd "mysqladmin ping"
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
1325
postgres:
1426
image: postgres
1527
env:
@@ -35,6 +47,7 @@ jobs:
3547
- 5.2.4.4
3648
- 5.1.7
3749
database_url:
50+
- mysql2://root:[email protected]:3306/test
3851
- postgresql://postgres:password@localhost:5432/test
3952
- sqlite3:test_db
4053
exclude:
@@ -59,4 +72,4 @@ jobs:
5972
- name: Install dependencies
6073
run: bundle install --jobs 4 --retry 3
6174
- name: Run tests
62-
run: bundle exec rake test
75+
run: bundle exec rake test

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ version = ENV['RAILS_VERSION'] || 'default'
1010

1111
platforms :ruby do
1212
gem 'pg'
13+
gem 'mysql2'
1314

1415
if version.start_with?('4.2', '5.0')
1516
gem 'sqlite3', '~> 1.3.13'
@@ -26,4 +27,4 @@ when 'default'
2627
gem 'railties', '>= 6.0'
2728
else
2829
gem 'railties', "~> #{version}"
29-
end
30+
end

0 commit comments

Comments
 (0)