diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 1c2087bc..469d9287 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -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: @@ -35,6 +47,7 @@ jobs: - 5.2.4.4 - 5.1.7 database_url: + - mysql2://root:root@127.0.0.1:3306/test - postgresql://postgres:password@localhost:5432/test - sqlite3:test_db exclude: @@ -59,4 +72,4 @@ jobs: - name: Install dependencies run: bundle install --jobs 4 --retry 3 - name: Run tests - run: bundle exec rake test \ No newline at end of file + run: bundle exec rake test diff --git a/Gemfile b/Gemfile index 2535d020..5c866218 100644 --- a/Gemfile +++ b/Gemfile @@ -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' @@ -26,4 +27,4 @@ when 'default' gem 'railties', '>= 6.0' else gem 'railties', "~> #{version}" -end \ No newline at end of file +end