Skip to content

Expand GHA test matrix #251

Expand GHA test matrix

Expand GHA test matrix #251

Workflow file for this run

---
name: Tests
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
jobs:
tests:
name: 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;"'
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;"'
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;"'
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'
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- run: rake test