Skip to content

[0.5.1] Fix connection creation with AR #77

[0.5.1] Fix connection creation with AR

[0.5.1] Fix connection creation with AR #77

Workflow file for this run

name: Ruby Gem CI/CD
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
test:
name: Lint, Typecheck, and External Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:9
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test_db
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
ruby: [ '3.1', '3.2', '3.3', '3.4' ]
steps:
- name: Checkout current project
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Run RuboCop
run: bundle exec rubocop
- name: Install RBS collection and run Steep
run: |
bundle exec rbs collection install
bundle exec rbs collection update
bundle exec steep check
######################################
# Multi-DB Test Case (dynamic-database-use)
######################################
- name: Run external multi-db test project
run: |
echo "Running multi-db tests from external project..."
git clone https://github.com/unurgunite/poc_arfi_72 external_multi
cd external_multi
git checkout dynamic-database-use
export PG_DB_USERNAME=postgres
export PG_DB_PASSWORD=password
export PG_DB_HOST=localhost
export PG_DB_PORT=5432
export MYSQL_DB_USERNAME=root
export MYSQL_DB_PASSWORD=password
export MYSQL_DB_HOST=127.0.0.1
export MYSQL_DB_PORT=3306
chmod +x ./bin/test_case.sh
bundle install
./bin/test_case.sh
######################################
# Single-DB Test Case (PostgreSQL only)
######################################
- name: Run external single-db test project
run: |
echo "Running single-db tests from external project (PostgreSQL only)..."
git clone https://github.com/unurgunite/poc_arfi_72 external_single
cd external_single
git checkout single-database-use
export PG_DB_USERNAME=postgres
export PG_DB_PASSWORD=password
export PG_DB_HOST=localhost
export PG_DB_PORT=5432
chmod +x ./bin/test_case.sh
bundle install
./bin/test_case.sh
release:
name: Release Ruby Gem
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Release Gem
uses: rubygems/release-gem@v1.1.1