Skip to content

run-test-suite

run-test-suite #348

Workflow file for this run

---
name: run-test-suite
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
test:
services:
postgres:
image: postgres:13
ports:
- "5432:5432"
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# manually create our with a locale
# POSTGRES_DB: postgres
POSTGRES_INITDB_ARGS: "--locale POSIX"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
env:
# locally: use database; SET PASSWORD FOR root@localhost = 'password';
MYSQL_ROOT_PASSWORD: password
# manually create with a locale
# MYSQL_DATABASE: test
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
runs-on: ubuntu-latest
strategy:
# fail-fast: false
matrix:
activerecord: [70, 71, 80, 81]
ruby: ["3.2"]
include:
- activerecord: 81
ruby: "3.4"
# - ruby: 2.7
# activerecord: 61
# rails 6.1 and 7.0 have different ruby versions
# - ruby: 2.7
# activerecord: 61
# - ruby: "3.0"
# activerecord: 61
env:
# for the pg cli (psql)
PGHOST: "127.0.0.1"
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
# for the mysql cli (mysql)
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
MYSQL_PWD: password
# for rails tests (from matrix)
BUNDLE_GEMFILE: gemfiles/gemfile_${{ matrix.activerecord }}.gemfile
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: run pg tests
env:
DB: pg
# latin1 locale on mac is borked, so just using ascii / c / posix
LOCALE: C
run: |
psql -U postgres --host 127.0.0.1 --port 5432 -c "create database hash_options_test ENCODING utf8 locale 'C' template template0;"
bundle exec rake
- name: run mysql tests
env:
DB: mysql2
MYSQL_DATABASE: hash_options_test
run: |
mysql --host 127.0.0.1 --port 3306 -uroot -e "CREATE DATABASE hash_options_test CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"
bundle exec rake
- name: run sqlite tests
env:
DB: sqlite3
run: bundle exec rake