Skip to content

Add mysql2 support

Add mysql2 support #57

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
jobs:
rspec:
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
POSTGRES_URL: postgres://postgres:postgres@localhost:5432
MYSQL_URL: mysql2://rails:rails@127.0.0.1:3306
DB: ${{ matrix.db }}
DB_NAME: slotted_counters_test
CI: true
strategy:
fail-fast: false
matrix:
ruby: ["3.0"]
gemfile: ["gemfiles/rails7.gemfile"]
db: ["mysql"]
include:
- ruby: "2.7"
gemfile: "gemfiles/rails6.gemfile"
db: "postgres"
- ruby: "3.1"
gemfile: "gemfiles/railsmaster.gemfile"
db: "postgres"
- ruby: "3.0"
gemfile: "gemfiles/rails7.gemfile"
db: "postgres"
- ruby: "2.7"
gemfile: "gemfiles/rails6.gemfile"
db: "mysql"
- ruby: "3.1"
gemfile: "gemfiles/railsmaster.gemfile"
db: "mysql"
services:
postgres:
image: postgres:14
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8
ports: [ "3306:3306" ]
env:
MYSQL_PASSWORD: rails
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: slotted_counters_test
MYSQL_USER: rails
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get -yqq install libpq-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Create DB
run: |
env PGPASSWORD=postgres createdb -h localhost -U postgres slotted_counters_test
- name: Run RSpec
run: |
bundle exec rspec -f d --force-color