Skip to content

Expand GHA test matrix #255

Expand GHA test matrix

Expand GHA test matrix #255

Workflow file for this run

---
name: Tests
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
jobs:
tests:
name: ${{ matrix.database }} / ActiveRecord ${{ matrix.activerecord-version }} / Ruby ${{ matrix.ruby-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
activerecord-version: ["6.0", "6.1", "7.0", "7.0.5", "7.1"]
ruby-version: ["2.7", "3.0", "3.1", "3.2"]
database:
- sqlite3
- mysql56
- mysql57
- mysql57-trilogy
- mysql80
- mysql80-trilogy
- pg12
include:
- {activerecord-version: "5.2", ruby-version: "2.7"}
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.activerecord-version }}.gemfile
DB: ${{ matrix.database }}
services:
mysql56:
image: ${{ (matrix.database == 'mysql56') && 'mysql:5.6' || '' }}
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: password
# command: --innodb-large-prefix --innodb-file-format=barracuda
options:
--health-cmd "mysql --password=password -e 'show databases;'"
--health-interval 2s
--health-timeout 1s
--health-retries 10
mysql57:
image: ${{ startsWith(matrix.database, 'mysql57') && 'mysql:5.7' || '' }}
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: password
options:
--health-cmd "mysql --password=password -e 'show databases;'"
--health-interval 2s
--health-timeout 1s
--health-retries 10
mysql80:
image: ${{ startsWith(matrix.database, 'mysql80') && 'mysql:8.0' || '' }}
ports:
- 3306:3306
# command: --default-authentication-plugin=mysql_native_password
env:
MYSQL_ROOT_PASSWORD: password
options:
--health-cmd "mysql --password=password -e 'show databases;'"
--health-interval 2s
--health-timeout 1s
--health-retries 10
pg12:
image: ${{ (matrix.database == 'pg12') && 'postgres:12' || '' }}
ports:
- 5432:5432
env:
PGDATA: /data
POSTGRES_DB: db
POSTGRES_HOST_AUTH_METHOD: trust
options:
--health-cmd "echo '\\l' | psql -U postgres"
--health-interval 2s
--health-timeout 1s
--health-retries 10
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- run: bundle exec rake test