Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Bring back Oracle DB tests #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
81 changes: 81 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -358,3 +358,84 @@ jobs:
run: |
curl -LO https://github.com/microsoft/mssql-jdbc/releases/download/v8.4.1/mssql-jdbc-8.4.1.jre11.jar
CLASSPATH=".:mssql-jdbc-8.4.1.jre11.jar" bundle exec rake test:mssql

job_test_oracle:
name: test oracle
runs-on: ubuntu-latest
env:
ORACLE_HOME: /opt/oracle/instantclient_21_13
services:
oracle:
image: container-registry.oracle.com/database/free:latest
ports:
- 1521:1521
env:
ORACLE_PWD: oraclepass
strategy:
fail-fast: false
matrix:
versions: [
# {ruby: '3.2', rails: 7_1, arelx: 2},
{ruby: '3.2', rails: 7, arelx: 2},
{ruby: '3.2', rails: 6_1, arelx: 2},
# {ruby: '3.1', rails: 7_1, arelx: 2},
{ruby: '3.1', rails: 7, arelx: 2},
{ruby: '3.1', rails: 6_1, arelx: 2},
# {ruby: '3.0', rails: 7_1, arelx: 2},
{ruby: '3.0', rails: 7, arelx: 2},
{ruby: '3.0', rails: 6_1, arelx: 2},
# {ruby: '2.7', rails: 7_1, arelx: 2},
{ruby: '2.7', rails: 7, arelx: 2},
{ruby: '2.7', rails: 6_1, arelx: 2},
{ruby: '2.7', rails: 6, arelx: 2},
{ruby: '2.7', rails: 5_2, arelx: 1},
{ruby: '2.7', rails: 4_2, arelx: 1},
{ruby: '2.5', rails: 6_1, arelx: 2},
{ruby: '2.5', rails: 6, arelx: 2},
{ruby: '2.5', rails: 5_2, arelx: 1},
{ruby: '2.5', rails: 4_2, arelx: 1},
{ruby: jruby-9.2, rails: 6_1, arelx: 2},
{ruby: jruby-9.2, rails: 6, arelx: 2},
{ruby: jruby-9.2, rails: 5_2, arelx: 1},
{ruby: jruby-9.2, rails: 4_2, arelx: 1},
{ruby: jruby-9.3, rails: 6_1, arelx: 2},
{ruby: jruby-9.3, rails: 6, arelx: 2},
{ruby: jruby-9.3, rails: 5_2, arelx: 1},
]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.versions.ruby }}
- name: Install FreeTDS
run: |
sudo apt-get update -q
sudo apt-get install -y freetds-dev libaio1
- name: Install Oracle Instant Client
run: |
sudo mkdir /opt/oracle
cd /opt/oracle
sudo wget https://download.oracle.com/otn_software/linux/instantclient/2113000/instantclient-basic-linux.x64-21.13.0.0.0dbru.zip
sudo wget https://download.oracle.com/otn_software/linux/instantclient/2113000/instantclient-sdk-linux.x64-21.13.0.0.0dbru.zip
sudo wget https://download.oracle.com/otn_software/linux/instantclient/2113000/instantclient-sqlplus-linux.x64-21.13.0.0.0dbru.zip
sudo unzip instantclient-basic-linux.x64-21.13.0.0.0dbru.zip
sudo unzip instantclient-sdk-linux.x64-21.13.0.0.0dbru.zip
sudo unzip instantclient-sqlplus-linux.x64-21.13.0.0.0dbru.zip
sudo sh -c "echo /opt/oracle/instantclient_21_13 > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig
- name: Update system-wide gems
if: ${{ !contains(fromJson('["2.5", "2.7", "jruby-9.2"]'), matrix.versions.ruby) }}
run: gem update --system --no-document
- name: Setup Gemfile
if: ${{ matrix.versions.arelx == 2 }}
run: |
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
cp ./version_v2.rb lib/arel_extensions/version.rb
cp ./gemfiles/rails${{ matrix.versions.rails }}.gemfile ./Gemfile
- name: bundle install
run: |
bundle config set gemfile ./gemfiles/rails${{ matrix.versions.rails }}.gemfile
bundle install
- name: Run test oracle
run: bundle exec rake test:oracle
2 changes: 1 addition & 1 deletion gemfiles/rails6_1.gemfile
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ group :development, :test do
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]

gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0' if ENV.has_key? 'ORACLE_HOME'
gem 'activerecord-oracle_enhanced-adapter', '~> 6.1.0' if ENV.has_key? 'ORACLE_HOME'

# for JRuby
gem 'activerecord-jdbc-adapter', github: 'jruby/activerecord-jdbc-adapter', tag: 'v61.1', platforms: :jruby
2 changes: 1 addition & 1 deletion gemfiles/rails7.gemfile
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ group :development, :test do
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]

gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0' if ENV.has_key? 'ORACLE_HOME'
gem 'activerecord-oracle_enhanced-adapter', '~> 7.0.0' if ENV.has_key? 'ORACLE_HOME'
end

gemspec path: Dir.pwd
7 changes: 4 additions & 3 deletions test/database.yml
Original file line number Diff line number Diff line change
@@ -34,9 +34,10 @@ jdbc-postgresql:
port: 5432
oracle:
adapter: oracle_enhanced
database: xe
username: ruby
password: oci8
database: FREE
username: SYSTEM
password: oraclepass
port: 1521
jdbc-oracle:
adapter: oracle_enhanced
database: xe
Loading