Skip to content

Test with multiple DB engines #52

Test with multiple DB engines

Test with multiple DB engines #52

Workflow file for this run

name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- run: bundle exec rake rubocop
test:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
ports:
- 3306:3306
env:
MARIADB_USER: user
MARIADB_PASSWORD: password
MARIADB_DATABASE: test
MARIADB_ROOT_PASSWORD: password
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:alpine
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
ruby-version: ["2.7", "3.0", "3.1", "3.2"]
gemfile: ["Gemfile", "Gemfile.rails6"]
database_url:
- ""
- "mysql2://user:password@localhost:3306/test"
- "postgresql://postgres:password@localhost:5432/test"
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- run: bundle exec rake spec