Skip to content

Commit

Permalink
Add multi-adapter workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed May 9, 2024
1 parent 8d1f268 commit 897d15f
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 10 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/audiences-pg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: audiences

on:
push:

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}
strategy:
fail-fast: false
matrix:
ruby:
- 3.0
- 3.1
- 3.2
- 3.3
gemfile:
- gemfiles/rails_6_1.gemfile
- gemfiles/rails_7_0.gemfile
- gemfiles/rails_7_1.gemfile
exclude:
- ruby: 3.2
gemfile: gemfiles/rails_6_1.gemfile
- ruby: 3.3
gemfile: gemfiles/rails_6_1.gemfile
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: test
POSTGRES_USER: pguser
POSTGRES_PASSWORD: pgpass
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install non-ruby dependencies
run: sudo apt-get install libpq-dev
- name: 'mysql2 adapter'
uses: powerhome/github-actions-workflows/ruby-gem@rubygem-action
env:
DATABASE_ADAPTER: mysql2
DATABASE_USER: root
DATABASE_PASS: root
DATABASE_HOST: 127.0.0.1
DATABASE_PORT: 3306
with:
workdir: audiences
ruby: ${{ matrix.ruby }}
gemfile: ${{ matrix.gemfile }}
- name: 'postgresql adapter'
uses: powerhome/github-actions-workflows/ruby-gem@rubygem-action
env:
DATABASE_ADAPTER: postgresql
DATABASE_USER: pguser
DATABASE_PASS: pgpass
DATABASE_HOST: 127.0.0.1
DATABASE_PORT: 5432
with:
workdir: audiences
ruby: ${{ matrix.ruby }}
gemfile: ${{ matrix.gemfile }}

license-compliance:
uses: ralexander-phi/license_approval@master
with:
working_directory: audiences
license_finder_version: 7.2.1
20 changes: 10 additions & 10 deletions audiences/spec/dummy/config/database.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
development:
adapter: mysql2
adapter: <%= ENV.fetch("DATABASE_ADAPTER", "mysql2") %>
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
username: <%= ENV.fetch("MYSQL_USER", "root") %>
password: <%= ENV.fetch("MYSQL_PASS", "root") %>
host: <%= ENV.fetch("MYSQL_HOST", "127.0.0.1") %>
port: 3306
username: <%= ENV.fetch("DATABASE_USER", "root") %>
password: <%= ENV.fetch("DATABASE_PASS", "root") %>
host: <%= ENV.fetch("DATABASE_HOST", "127.0.0.1") %>
port: <%= ENV.fetch("DATABASE_PORT", "3306") %>
database: development

test:
adapter: mysql2
adapter: <%= ENV.fetch("DATABASE_ADAPTER", "mysql2") %>
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
username: <%= ENV.fetch("MYSQL_USER", "root") %>
password: <%= ENV.fetch("MYSQL_PASS", "root") %>
host: <%= ENV.fetch("MYSQL_HOST", "127.0.0.1") %>
port: 3306
username: <%= ENV.fetch("DATABASE_USER", "root") %>
password: <%= ENV.fetch("DATABASE_PASS", "root") %>
host: <%= ENV.fetch("DATABASE_HOST", "127.0.0.1") %>
port: <%= ENV.fetch("DATABASE_PORT", "3306") %>
database: test

0 comments on commit 897d15f

Please sign in to comment.