Skip to content

test: test inside a dummy app. #174

test: test inside a dummy app.

test: test inside a dummy app. #174

Workflow file for this run

---
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
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.4'
- 'jruby'
- 'truffleruby'
rails:
- '8.0'
- '7.2'
- '7.1'
exclude:
# JRuby doesn't support Rails 8.0 yet
- ruby: 'jruby'
rails: '7.2'
- ruby: 'jruby'
rails: '8.0'
# TruffleRuby also has compatibility issues with Rails 8.0
- ruby: 'truffleruby'
rails: '8.0'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
rubygems: latest
env:
RAILS_VERSION: ${{ matrix.rails }}
RAILS_ENV: test
- name: Setup databases
env:
RAILS_ENV: test
RAILS_VERSION: ${{ matrix.rails }}
DATABASE_URL_PG: postgres://postgres:[email protected]:5432/closure_tree_test
DATABASE_URL_MYSQL: mysql2://root:[email protected]:3306/closure_tree_test
DATABASE_URL_SQLITE3: 'sqlite3::memory:'
run: |
cd test/dummy
bundle exec rails db:schema:load
- name: Test
env:
RAILS_ENV: test
RAILS_VERSION: ${{ matrix.rails }}
DATABASE_URL_PG: postgres://postgres:[email protected]:5432/closure_tree_test
DATABASE_URL_MYSQL: mysql2://root:[email protected]:3306/closure_tree_test
DATABASE_URL_SQLITE3: 'sqlite3::memory:'
WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }}
run: bin/rails test