Skip to content

Update CI config, add support for Rails 8 #956

Update CI config, add support for Rails 8

Update CI config, add support for Rails 8 #956

Workflow file for this run

name: CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
name: ${{ matrix.feature }} ruby-${{ matrix.ruby }} ${{ matrix.orm.name }}-${{ matrix.orm.version}} ${{ matrix.database }}
strategy:
fail-fast: false
matrix:
ruby:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
database:
- 'sqlite3'
- 'mysql'
- 'postgres'
orm:
- name: 'active_record'
version: '6.1'
- name: 'active_record'
version: '7.0'
- name: 'active_record'
version: '7.1'
- name: 'active_record'
version: '7.2'
- name: 'active_record'
version: '8.0'
- name: 'sequel'
version: '5'
experimental: [false]
feature: ['unit']
exclude:
- ruby: '3.0'
database: 'sqlite3'
orm:
name: 'active_record'
version: '7.2'
- ruby: '3.0'
database: 'mysql'
orm:
name: 'active_record'
version: '7.2'
- ruby: '3.0'
database: 'postgres'
orm:
name: 'active_record'
version: '7.2'
include:
# rails/sqlite3/active_record-7.2
- ruby: '3.3'
feature: 'rails'
orm:
name: 'active_record'
version: '7.2'
database: 'sqlite3'
experimental: false
- ruby: '3.2'
feature: 'rails'
orm:
name: 'active_record'
version: '7.2'
database: 'sqlite3'
experimental: false
- ruby: '3.1'
feature: 'rails'
orm:
name: 'active_record'
version: '7.2'
database: 'sqlite3'
experimental: false
# unit/postgres/edge
- ruby: '3.3'
database: 'postgres'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.2'
database: 'postgres'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
# unit/mysql/edge
- ruby: '3.3'
database: 'mysql'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.2'
database: 'mysql'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
# unit/sqlite3/edge
- ruby: '3.3'
database: 'sqlite3'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.2'
database: 'sqlite3'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
# i18n fallbacks
- ruby: '3.3'
feature: 'i18n_fallbacks'
experimental: false
- ruby: '3.2'
feature: 'i18n_fallbacks'
experimental: false
- ruby: '3.1'
feature: 'i18n_fallbacks'
experimental: false
- ruby: '3.0'
feature: 'i18n_fallbacks'
experimental: false
# Performance tests
- ruby: '3.3'
feature: 'performance'
experimental: false
- ruby: '3.2'
feature: 'performance'
experimental: false
- ruby: '3.1'
feature: 'performance'
experimental: false
- ruby: '3.0'
feature: 'performance'
experimental: false
# Unit tests
- ruby: '3.3'
feature: 'unit'
orm:
experimental: false
- ruby: '3.2'
feature: 'unit'
orm:
experimental: false
- ruby: '3.1'
feature: 'unit'
orm:
experimental: false
- ruby: '3.0'
feature: 'unit'
orm:
experimental: false
env:
DB: ${{ matrix.database }}
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
ORM: ${{ matrix.orm.name }}
ORM_VERSION: ${{ matrix.orm.version }}
MYSQL_PASSWORD: root
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
RAILS_ENV: test
FEATURE: ${{ matrix.feature }}
services:
postgres:
image: postgres:11.5
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:5.7
ports: ["3306:3306"]
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
env:
MYSQL_ROOT_PASSWORD: root
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update packages
run: sudo apt-get update
- name: Install Sqlite
run: sudo apt-get install libsqlite3-dev -y
if: matrix.database == 'sqlite3'
- name: Install Postgres
run: sudo apt-get install libpq-dev postgresql-client -y
if: matrix.database == 'postgres'
- id: cache-bundler
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-${{ matrix.orm.name }}-${{ matrix.orm.version }}-${{ matrix.feature }}-${{ hashFiles('mobility.gemspec') }}-${{ hashFiles('Gemfile') }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install latest Bundler
run: gem install bundler --no-document
- name: Install dependencies
run: bundle install
- name: Setup test db
run: bundle exec rake db:create db:up
if: matrix.database
- name: Run tests
run: bundle exec rake