Skip to content

feat: Multiple database support #111

feat: Multiple database support

feat: Multiple database support #111

Workflow file for this run

---
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ci-${{ github.head_ref }}
cancel-in-progress: true
jobs:
rspec:
runs-on: ubuntu-latest
services:
mysql:
image: mysql/mysql-server
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: closure_tree_test
MYSQL_ROOT_HOST: '%'
postgres:
image: 'postgres'
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: closure_tree_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
ruby:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
rails:
- activerecord_7.1
- activerecord_7.0
- activerecord_6.1
- activerecord_edge
adapter:
- '' # SQLite3
- mysql2://root:root@0/closure_tree_test
- postgres://closure_tree:closure_tree@0/closure_tree_test
exclude:
- ruby: '3.0'
rails: activerecord_edge
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
rubygems: latest
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
RAILS_ENV: test
- name: RSpec
env:
RAILS_VERSION: ${{ matrix.rails }}
DATABASE_URL: ${{ matrix.adapter }}
SECONDARY_DATABASE_URL: ${{ matrix.adapter }}_secondary
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }}
run: bin/rake