Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 96 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: CI
name: build

on:
push:
branches: [main]
pull_request:
branches: [main]
branches: "*"

jobs:
style:
Expand All @@ -24,3 +19,97 @@ jobs:
ruby-version: "2.7"
bundler-cache: true
- run: bundle exec standardrb --format github

test-mysql:
name: Tests (MySQL)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [2.7, jruby-9.4]

services:
mysql:
image: mysql:5.7
ports:
- 3306
env:
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
MYSQL_USER: root
MYSQL_PASSWORD: root

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup database
run: |
sudo service mysql start
- name: Run tests
run: |
bundle exec rake test:mysql2

test-pgsql:
name: Tests (Postgres)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [2.7, jruby-9.4]

services:
postgres:
image: postgres:11
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

env:
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup database
env:
PGPASSWORD: postgres
run: |
createdb spectacles_test
- name: Run tests
run: |
bundle exec rake test:postgresql

test-sqlite:
name: Tests (SQLite)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [2.7, jruby-9.4]

env:
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: |
bundle exec rake test:sqlite3
60 changes: 0 additions & 60 deletions .github/workflows/ruby.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

17 changes: 0 additions & 17 deletions Appraisals

This file was deleted.

1 change: 1 addition & 0 deletions lib/spectacles/schema_statements/postgresql_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def views(name = nil) # :nodoc:
FROM information_schema.views AS t
INNER JOIN pg_class AS c ON c.relname = t.table_name AND c.relnamespace = to_regnamespace(t.table_schema)::oid
WHERE t.table_schema = ANY(current_schemas(true))
AND table_schema NOT IN ('information_schema', 'pg_catalog')
AND pg_catalog.pg_get_userbyid(c.relowner) = #{quote(database_username)}
SQL

Expand Down
5 changes: 5 additions & 0 deletions specs/adapters/mysql2_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
password: ENV["MYSQL_PASSWORD"]
}

if defined? JRUBY_VERSION
config[:properties] ||= {}
config[:properties]["allowPublicKeyRetrieval"] = true
end

configure_database(config)
recreate_database("spectacles_test")
load_schema
Expand Down