test: test inside a dummy app. #168
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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' | |
- 'edge' | |
exclude: | |
# JRuby doesn't support Rails 8.0 yet | |
- ruby: 'jruby' | |
rails: '8.0' | |
- ruby: 'jruby' | |
rails: 'edge' | |
# TruffleRuby also has compatibility issues with Rails 8.0 | |
- ruby: 'truffleruby' | |
rails: '8.0' | |
- ruby: 'truffleruby' | |
rails: 'edge' | |
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: Test | |
env: | |
RAILS_ENV: test | |
RAILS_VERSION: ${{ matrix.rails }} | |
DATABASE_URL_PG: postgres://postgres:postgres@localhost/closure_tree_test | |
DATABASE_URL_MYSQL: mysql2://root:root@localhost/closure_tree_test | |
DATABASE_URL_SQLITE3: 'sqlite3::memory:' | |
WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }} | |
run: bin/rails test |