Skip to content

Commit 8cb457d

Browse files
committed
Update Oracle CI
1 parent 2e6315a commit 8cb457d

File tree

9 files changed

+136
-52
lines changed

9 files changed

+136
-52
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ jobs:
3737

3838
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
3939
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.rails }}_with_${{ matrix.adapter }}.gemfile
40-
ORACLE_COOKIE: sqldev
41-
ORACLE_FILE: oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip
42-
ORACLE_HOME: /u01/app/oracle/product/11.2.0/xe
43-
ORACLE_SID: XE
4440

4541
services:
4642
postgres:
@@ -86,7 +82,6 @@ jobs:
8682
- sqlite3
8783
- postgresql
8884
- mysql2
89-
# - oracle_enhanced
9085
- postgis
9186
# Disabled for now:
9287
# Rails 7.0: trilogy_auth_recv: caching_sha2_password requires either TCP with TLS or a unix socket: TRILOGY_UNSUPPORTED
@@ -98,28 +93,13 @@ jobs:
9893
- rails: 'rails_8.0'
9994
ruby: '3.1'
10095

101-
# Disabled for now because of build error:
102-
# /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/psych.rb:457:in
103-
# `parse_stream': undefined method `parse' for #<Psych::Parser:0x000055b6cc7b6898
104-
# @handler=#<Psych::Handlers::DocumentStream:0x000055b6cc7b69b0 @stack=[],
105-
# @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil,
106-
# @end_column=nil, @block=#<Proc:0x000055b6cc7b68e8
107-
# /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/psych.rb:391>>,
108-
# @external_encoding=0> (NoMethodError)
109-
# from
110-
# /home/runner/work/ajax-datatables-rails/ajax-datatables-rails/vendor/bundle/ruby/3.0.0/gems/ruby-oci8-2.2.14/ext/oci8/apiwrap.rb:64:in
111-
# `create_apiwrap'
112-
- rails: 'rails_7.2'
113-
adapter: 'oracle_enhanced'
114-
11596
steps:
11697
- name: Checkout
11798
uses: actions/checkout@v4
11899

119100
- name: Set DB Adapter
120101
env:
121102
DB_ADAPTER: ${{ matrix.adapter }}
122-
CUSTOM_ORACLE_FILE: ${{ secrets.CUSTOM_ORACLE_FILE }}
123103

124104
# See: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#mysql
125105
run: |
@@ -128,12 +108,6 @@ jobs:
128108
mysql -u root -proot -e 'create database ajax_datatables_rails;'
129109
fi
130110
131-
if [[ "${DB_ADAPTER}" == "oracle_enhanced" ]]; then
132-
./spec/install_oracle.sh
133-
# Fix error : libnnz11.so: cannot open shared object file: No such file or directory
134-
sudo ln -s ${ORACLE_HOME}/lib/libnnz11.so /usr/lib/libnnz11.so
135-
fi
136-
137111
- name: Setup Ruby
138112
uses: ruby/setup-ruby@v1
139113
with:

.github/workflows/ci_oracle.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
name: CI Oracle
3+
4+
on:
5+
push:
6+
branches:
7+
- '**'
8+
pull_request:
9+
branches:
10+
- '**'
11+
schedule:
12+
- cron: '0 4 1 * *'
13+
# Run workflow manually
14+
workflow_dispatch:
15+
16+
jobs:
17+
rspec:
18+
runs-on: ubuntu-latest
19+
20+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
21+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.rails }}_with_${{ matrix.adapter }}.gemfile
22+
ORACLE_HOME: /opt/oracle/instantclient_23_8
23+
LD_LIBRARY_PATH: /opt/oracle/instantclient_23_8
24+
DATABASE_SYS_PASSWORD: Oracle18
25+
DATABASE_NAME: FREEPDB1
26+
27+
services:
28+
oracle:
29+
image: gvenzl/oracle-free:latest
30+
ports:
31+
- 1521:1521
32+
env:
33+
TZ: Europe/Paris
34+
ORACLE_PASSWORD: Oracle18
35+
options: >-
36+
--health-cmd healthcheck.sh
37+
--health-interval 10s
38+
--health-timeout 5s
39+
--health-retries 10
40+
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
ruby:
45+
- '3.4'
46+
# - '3.3'
47+
# - '3.2'
48+
# - '3.1'
49+
# - 'head'
50+
rails:
51+
- rails_8.0
52+
# - rails_7.2
53+
# - rails_7.1
54+
adapter:
55+
- oracle_enhanced
56+
# exclude:
57+
# # Disabled for now because of build error:
58+
# # /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/psych.rb:457:in
59+
# # `parse_stream': undefined method `parse' for #<Psych::Parser:0x000055b6cc7b6898
60+
# # @handler=#<Psych::Handlers::DocumentStream:0x000055b6cc7b69b0 @stack=[],
61+
# # @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil,
62+
# # @end_column=nil, @block=#<Proc:0x000055b6cc7b68e8
63+
# # /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/psych.rb:391>>,
64+
# # @external_encoding=0> (NoMethodError)
65+
# # from
66+
# # /home/runner/work/ajax-datatables-rails/ajax-datatables-rails/vendor/bundle/ruby/3.0.0/gems/ruby-oci8-2.2.14/ext/oci8/apiwrap.rb:64:in
67+
# # `create_apiwrap'
68+
# - rails: 'rails_7.2'
69+
# adapter: 'oracle_enhanced'
70+
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
75+
- name: Create symbolic link for libaio library compatibility
76+
run: |
77+
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
78+
79+
- name: Download Oracle instant client
80+
run: |
81+
wget -q https://download.oracle.com/otn_software/linux/instantclient/2380000/instantclient-basic-linux.x64-23.8.0.25.04.zip
82+
wget -q https://download.oracle.com/otn_software/linux/instantclient/2380000/instantclient-sdk-linux.x64-23.8.0.25.04.zip
83+
wget -q https://download.oracle.com/otn_software/linux/instantclient/2380000/instantclient-sqlplus-linux.x64-23.8.0.25.04.zip
84+
85+
- name: Install Oracle instant client
86+
run: |
87+
sudo unzip instantclient-basic-linux.x64-23.8.0.25.04.zip -d /opt/oracle/
88+
sudo unzip -o instantclient-sdk-linux.x64-23.8.0.25.04.zip -d /opt/oracle/
89+
sudo unzip -o instantclient-sqlplus-linux.x64-23.8.0.25.04.zip -d /opt/oracle/
90+
echo "/opt/oracle/instantclient_23_8" >> $GITHUB_PATH
91+
92+
- name: Create database user
93+
run: |
94+
./ci/setup_accounts.sh
95+
96+
- name: Setup Ruby
97+
uses: ruby/setup-ruby@v1
98+
with:
99+
ruby-version: ${{ matrix.ruby }}
100+
bundler-cache: true
101+
env:
102+
DB_ADAPTER: ${{ matrix.adapter }}
103+
104+
- name: Run RSpec
105+
env:
106+
DB_ADAPTER: ${{ matrix.adapter }}
107+
run: bin/rspec
108+
109+
- name: Publish code coverage
110+
uses: qltysh/qlty-action/coverage@v1
111+
with:
112+
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
113+
files: coverage/coverage.json

Appraisals

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ end
6868

6969
appraise 'rails_7.2_with_oracle_enhanced' do
7070
gem 'rails', '~> 7.2.0'
71-
gem 'activerecord-oracle_enhanced-adapter', git: 'https://github.com/rsim/oracle-enhanced.git'
71+
gem 'activerecord-oracle_enhanced-adapter', '~> 7.2.0'
7272
remove_gem 'pg'
7373
end
7474

@@ -107,7 +107,7 @@ end
107107

108108
appraise 'rails_8.0_with_oracle_enhanced' do
109109
gem 'rails', '~> 8.0.0'
110-
gem 'activerecord-oracle_enhanced-adapter', git: 'https://github.com/rsim/oracle-enhanced.git'
110+
gem 'activerecord-oracle_enhanced-adapter', '~> 8.0.0'
111111
remove_gem 'pg'
112112
end
113113

ci/setup_accounts.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -ev
4+
5+
sqlplus sys/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME} as sysdba<<SQL
6+
@@spec/support/create_oracle_enhanced_users.sql
7+
exit
8+
SQL

gemfiles/rails_7.2_with_oracle_enhanced.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ gem "rubocop-performance", require: false
2020
gem "rubocop-rake", require: false
2121
gem "rubocop-rspec", require: false
2222
gem "rails", "~> 7.2.0"
23-
gem "activerecord-oracle_enhanced-adapter", git: "https://github.com/rsim/oracle-enhanced.git"
23+
gem "activerecord-oracle_enhanced-adapter", "~> 7.2.0"
2424

2525
gemspec path: "../"

gemfiles/rails_8.0_with_oracle_enhanced.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ gem "rubocop-performance", require: false
2020
gem "rubocop-rake", require: false
2121
gem "rubocop-rspec", require: false
2222
gem "rails", "~> 8.0.0"
23-
gem "activerecord-oracle_enhanced-adapter", git: "https://github.com/rsim/oracle-enhanced.git"
23+
gem "activerecord-oracle_enhanced-adapter", "~> 8.0.0"
2424

2525
gemspec path: "../"

spec/dummy/config/database.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ test:
1515
username: 'root'
1616
password: 'root'
1717
<% elsif adapter == 'oracle_enhanced' %>
18-
host: '127.0.0.1/xe'
19-
username: <%= ENV.fetch('USER') %>
20-
password: <%= ENV.fetch('USER') %>
21-
database: 'xe'
18+
host: '127.0.0.1'
19+
username: 'oracle_enhanced'
20+
password: 'oracle_enhanced'
21+
database: 'FREEPDB1'
2222
<% elsif adapter == 'sqlite3' %>
2323
# database: ':memory:'
2424
database: db/ajax_datatables_rails.sqlite3

spec/install_oracle.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
alter database default tablespace USERS;
2+
3+
CREATE USER oracle_enhanced IDENTIFIED BY oracle_enhanced;
4+
5+
GRANT unlimited tablespace, create session, create table, create sequence,
6+
create procedure, create trigger, create view, create materialized view,
7+
create database link, create synonym, create type, ctxapp TO oracle_enhanced;

0 commit comments

Comments
 (0)