Skip to content

Commit d803158

Browse files
authored
Merge pull request #2327 from yahonda/github_actions_run_oracle11g
Run Oracle Database 11g CI using GitHub Actions
2 parents d3ce80e + 01b2772 commit d803158

File tree

3 files changed

+104
-1
lines changed

3 files changed

+104
-1
lines changed

.github/workflows/test_11g.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: test_11g
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
# Rails 7.0 requires Ruby 2.7 or higeher.
17+
# CI pending the following matrix until JRuby 9.4 that supports Ruby 2.7 will be released.
18+
# https://github.com/jruby/jruby/issues/6464
19+
# - jruby,
20+
# - jruby-head
21+
ruby: [
22+
'3.2',
23+
'3.1',
24+
'3.0',
25+
'2.7',
26+
'truffleruby-head'
27+
]
28+
env:
29+
ORACLE_HOME: /usr/lib/oracle/21/client64
30+
LD_LIBRARY_PATH: /usr/lib/oracle/21/client64/lib
31+
NLS_LANG: AMERICAN_AMERICA.AL32UTF8
32+
TNS_ADMIN: ./ci/network/admin
33+
DATABASE_NAME: XE
34+
TZ: Europe/Riga
35+
DATABASE_SYS_PASSWORD: Oracle18
36+
DATABASE_HOST: localhost
37+
DATABASE_PORT: 1521
38+
DATABASE_VERSION: 11.2.0.2
39+
40+
services:
41+
oracle:
42+
image: gvenzl/oracle-xe:11
43+
ports:
44+
- 1521:1521
45+
env:
46+
TZ: Europe/Riga
47+
ORACLE_PASSWORD: Oracle18
48+
options: >-
49+
--health-cmd healthcheck.sh
50+
--health-interval 10s
51+
--health-timeout 5s
52+
--health-retries 10
53+
steps:
54+
- uses: actions/checkout@v3
55+
- name: Set up Ruby
56+
uses: ruby/setup-ruby@v1
57+
with:
58+
ruby-version: ${{ matrix.ruby }}
59+
- name: Install required package
60+
run: |
61+
sudo apt-get install alien
62+
- name: Download Oracle client
63+
run: |
64+
wget -q https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-basic-21.9.0.0.0-1.x86_64.rpm
65+
wget -q https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-sqlplus-21.9.0.0.0-1.x86_64.rpm
66+
wget -q https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-devel-21.9.0.0.0-1.x86_64.rpm
67+
- name: Install Oracle client
68+
run: |
69+
sudo alien -i oracle-instantclient-basic-21.9.0.0.0-1.x86_64.rpm
70+
sudo alien -i oracle-instantclient-sqlplus-21.9.0.0.0-1.x86_64.rpm
71+
sudo alien -i oracle-instantclient-devel-21.9.0.0.0-1.x86_64.rpm
72+
- name: Install JDBC Driver
73+
run: |
74+
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/211/ojdbc11.jar -O ./lib/ojdbc11.jar
75+
- name: Create database user
76+
run: |
77+
./ci/setup_accounts.sh
78+
- name: Bundle install
79+
run: |
80+
bundle install --jobs 4 --retry 3
81+
- name: Run RSpec
82+
run: |
83+
bundle exec rspec
84+
- name: Workaround jruby-head failure by removing Gemfile.lock
85+
run: |
86+
rm Gemfile.lock
87+
- name: Run bug report templates
88+
if: "false"
89+
run: |
90+
cd guides/bug_report_templates
91+
ruby active_record_gem.rb
92+
ruby active_record_gem_spec.rb

ci/network/admin/tnsnames.ora

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ XEPDB1 =
55
(SERVICE_NAME = XEPDB1)
66
)
77
)
8+
9+
XE =
10+
(DESCRIPTION =
11+
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
12+
(CONNECT_DATA =
13+
(SERVICE_NAME = XE)
14+
)
15+
)

spec/active_record/oracle_enhanced/type/timestamp_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
include SchemaSpecHelper
55

66
before(:all) do
7+
if ENV["DATABASE_VERSION"] == "11.2.0.2" && ENV["ORACLE_HOME"] == "/usr/lib/oracle/21/client64"
8+
skip
9+
end
710
ActiveRecord.default_timezone = :local
811
ActiveRecord::Base.establish_connection(CONNECTION_WITH_TIMEZONE_PARAMS)
912
@conn = ActiveRecord::Base.connection
@@ -27,7 +30,7 @@
2730
end
2831

2932
after(:all) do
30-
@conn.drop_table :test_employees, if_exists: true
33+
@conn.drop_table :test_employees, if_exists: true rescue nil
3134
ActiveRecord.default_timezone = :utc
3235
end
3336

0 commit comments

Comments
 (0)