-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get GitHub actions running green on 6.0 → 8.0 (#37)
Co-authored-by: Frederik Erbs Spang Thomsen <[email protected]>
- Loading branch information
1 parent
87cc337
commit 8ebe558
Showing
17 changed files
with
293 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: RSpec Test Matrix | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgresql: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
env: | ||
POSTGRES_DB: active_record_union | ||
POSTGRES_USER: active_record_union | ||
POSTGRES_PASSWORD: active_record_union | ||
|
||
mysql2: | ||
image: mysql:8.0 | ||
env: | ||
MYSQL_DATABASE: active_record_union | ||
MYSQL_ROOT_PASSWORD: active_record_union | ||
options: >- | ||
--health-cmd "mysqladmin ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
ports: | ||
- "3306:3306" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# just define specific versions for each rails version | ||
include: | ||
- ruby: 2.6 | ||
rails: "6.0" | ||
- ruby: "3.0" | ||
rails: 6.1 | ||
- ruby: 3.1 | ||
rails: "7.0" | ||
- ruby: 3.2 | ||
rails: 7.1 | ||
- ruby: 3.2 | ||
rails: 7.2 | ||
- ruby: 3.3 | ||
rails: "8.0" | ||
|
||
env: | ||
BUNDLE_GEMFILE: "rails_${{ matrix.rails }}.gemfile" | ||
DB_HOST: 127.0.0.1 | ||
MYSQL_ROOT_HOST: "%" | ||
MYSQL_DB: active_record_union | ||
MYSQL_USER: root | ||
MYSQL_PASSWORD: active_record_union | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true # install gems and cache | ||
|
||
- run: bundle exec rspec --force-color --format d |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# this is just a convenience for out of the box development | ||
source 'https://rubygems.org' | ||
|
||
eval_gemfile File.expand_path('./rails_8.0.gemfile', __dir__) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
GREEN='\033[0;32m' | ||
RESET_COLOR='\033[0m' | ||
|
||
if [ -n "$1" ]; then cat <<'HELP'; exit; fi | ||
Usage: bin/create-db-users | ||
Create the active_record_union database users for all the supported databases. | ||
If the `DB` environment variable is set, do the above only for that database. | ||
HELP | ||
|
||
USER='active_record_union' | ||
PASS='active_record_union' | ||
|
||
set -e | ||
log() { if [ -t 1 ]; then echo -e >&2 "${GREEN}create-db-users: $@${RESET_COLOR}"; else echo >&2 "$@"; fi } | ||
|
||
create_mysql_user() { | ||
if mysql -s -u"$USER" -p"$PASS" -e '' 2>/dev/null; then return; fi | ||
log "Creating MySQL '$USER' user. MySQL root password required." | ||
mysql --verbose -uroot -p <<SQL | ||
CREATE USER '$USER'@'localhost' IDENTIFIED BY '$PASS'; | ||
GRANT ALL PRIVILEGES ON \`test_active_record_union\`.* TO '$USER'@'localhost'; | ||
SQL | ||
} | ||
|
||
create_postgresql_user() { | ||
if PGPASSWORD="$PASS" psql -h 127.0.0.1 postgres -U $USER -c ''; then return; fi | ||
log "Creating Postgres '$USER' user." | ||
local cmd='psql postgres' | ||
if ! $cmd -c '' 2>/dev/null; then | ||
log "sudo required:" | ||
cmd="sudo -u ${PG_DAEMON_USER:-postgres} psql postgres" | ||
fi | ||
# need to also create database first time | ||
$cmd --echo-all <<SQL | ||
CREATE ROLE $USER LOGIN PASSWORD '$PASS'; | ||
ALTER ROLE $USER CREATEDB; | ||
CREATE DATABASE active_record_union; | ||
SQL | ||
} | ||
|
||
[ -z "$DB" -o "$DB" = 'mysql2' ] && create_mysql_user | ||
[ -z "$DB" -o "$DB" = 'postgresql' ] && create_postgresql_user |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in active_record_union.gemspec | ||
gemspec | ||
|
||
gem 'rails', '~> 6.0.0' | ||
|
||
# https://github.com/rails/rails/blob/v6.0.6.1/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | ||
gem "pg", ">= 0.18", "< 2.0" | ||
|
||
# https://github.com/rails/rails/blob/v6.0.2/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13 | ||
gem "sqlite3", "~> 1.4" | ||
|
||
# https://github.com/rails/rails/blob/v6.0.6.1/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | ||
gem "mysql2", ">= 0.4.4" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in active_record_union.gemspec | ||
gemspec | ||
|
||
gem 'rails', '~> 6.1.0' | ||
|
||
# https://github.com/rails/rails/blob/v6.1.7.10/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | ||
gem "pg", "~> 1.1" | ||
|
||
# https://github.com/rails/rails/blob/v6.1.2/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13 | ||
gem "sqlite3", "~> 1.4" | ||
|
||
# https://github.com/rails/rails/blob/v6.1.7.10/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | ||
gem "mysql2", "~> 0.5" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in active_record_union.gemspec | ||
gemspec | ||
|
||
gem 'rails', '~> 7.0.0' | ||
|
||
# https://github.com/rails/rails/blob/v7.0.2/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13 | ||
gem 'sqlite3', '~> 1.4' | ||
|
||
# https://github.com/rails/rails/blob/v7.0.2/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L4 | ||
gem 'pg', '~> 1.1' | ||
|
||
# https://github.com/rails/rails/blob/v7.0.2/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 | ||
gem 'mysql2', '~> 0.5' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in active_record_union.gemspec | ||
gemspec | ||
|
||
gem 'rails', '~> 7.1.0' | ||
|
||
# https://github.com/rails/rails/blob/v7.1.2/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13 | ||
gem 'sqlite3', '~> 1.4' | ||
|
||
# https://github.com/rails/rails/blob/v7.1.2/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L4 | ||
gem 'pg', '~> 1.1' | ||
|
||
# https://github.com/rails/rails/blob/v7.1.2/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 | ||
gem 'mysql2', '~> 0.5' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in active_record_union.gemspec | ||
gemspec | ||
|
||
gem 'rails', '~> 7.2.0' | ||
|
||
# https://github.com/rails/rails/blob/v7.2.0/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13 | ||
gem 'sqlite3', '>= 1.4' | ||
|
||
# https://github.com/rails/rails/blob/v7.2.0/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L4 | ||
gem 'pg', '~> 1.1' | ||
|
||
# https://github.com/rails/rails/blob/v7.2.0/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 | ||
gem 'mysql2', '~> 0.5' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in active_record_union.gemspec | ||
gemspec | ||
|
||
gem 'rails', '~> 8.0.0' | ||
|
||
# https://github.com/rails/rails/blob/main/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13 | ||
gem 'sqlite3', '>= 2.1' | ||
|
||
# https://github.com/rails/rails/blob/main/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L4 | ||
gem 'pg', '~> 1.1' | ||
|
||
# https://github.com/rails/rails/blob/main/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 | ||
gem 'mysql2', '~> 0.5' |
This file contains 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
This file contains 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
Oops, something went wrong.