Skip to content

Commit 5c53eb7

Browse files
committed
Add ARJDBC tests on pgsql
1 parent 34fecfc commit 5c53eb7

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

.github/workflows/ruby.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,56 @@ jobs:
6969
run: |
7070
bundle exec rake ${{ matrix.test_targets }}
7171
72+
test-rails-pgsql:
73+
74+
name: Rails Tests (Postgres)
75+
runs-on: ubuntu-latest
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
ruby-version: [ 'jruby-9.2.20.1' ]
80+
db: [ 'postgresql' ]
81+
test_targets: [ "rails:test_postgresql" ]
82+
ar_version: ["6-1-stable"]
83+
prepared_statements: [ 'false', 'true' ]
84+
85+
services:
86+
postgres:
87+
image: postgres:10
88+
env:
89+
POSTGRES_PASSWORD: postgres
90+
POSTGRES_HOST_AUTH_METHOD: trust
91+
ports:
92+
- 5432:5432
93+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
94+
95+
env:
96+
DB: ${{ matrix.db }}
97+
AR_VERSION: ${{ matrix.ar_version }}
98+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
99+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
100+
PGHOST: localhost
101+
PGPORT: 5432
102+
PGUSER: postgres
103+
104+
steps:
105+
- uses: actions/checkout@v3
106+
- name: Set up Ruby
107+
uses: ruby/setup-ruby@v1
108+
with:
109+
ruby-version: ${{ matrix.ruby-version }}
110+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
111+
- name: Setup database
112+
run: |
113+
psql -c "create database activerecord_unittest;" -U postgres
114+
psql -c "create database activerecord_unittest2;" -U postgres
115+
- name: Build
116+
run: |
117+
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
118+
- name: Run tests
119+
run: |
120+
bundle exec rake ${{ matrix.test_targets }}
121+
72122
test-rails-sqlite:
73123

74124
name: Rails Tests (SQLite)
@@ -146,6 +196,53 @@ jobs:
146196
run: |
147197
bundle exec rake ${{ matrix.test_targets }}
148198
199+
test-arjdbc-pgsql:
200+
201+
name: ARJDBC Tests (Postgres)
202+
runs-on: ubuntu-latest
203+
strategy:
204+
fail-fast: false
205+
matrix:
206+
ruby-version: ['jruby-9.2.20.1']
207+
db: ['postgresql']
208+
test_targets: ["db:postgresql test_postgresql"]
209+
prepared_statements: ['false', 'true']
210+
insert_returning: ['false', 'true']
211+
212+
services:
213+
postgres:
214+
image: postgres:10
215+
env:
216+
POSTGRES_PASSWORD: postgres
217+
POSTGRES_HOST_AUTH_METHOD: trust
218+
ports:
219+
- 5432:5432
220+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
221+
222+
env:
223+
DB: ${{ matrix.db }}
224+
DRIVER: ${{ matrix.driver }}
225+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
226+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
227+
INSERT_RETURNING: ${{ matrix.insert_returning }}
228+
PGHOST: localhost
229+
PGPORT: 5432
230+
PGUSER: postgres
231+
232+
steps:
233+
- uses: actions/checkout@v3
234+
- name: Set up Ruby
235+
uses: ruby/setup-ruby@v1
236+
with:
237+
ruby-version: ${{ matrix.ruby-version }}
238+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
239+
- name: Build
240+
run: |
241+
rake jar
242+
- name: Run tests
243+
run: |
244+
bundle exec rake ${{ matrix.test_targets }}
245+
149246
test-arjdbc-sqlite:
150247

151248
name: ARJDBC Tests (SQLite)

0 commit comments

Comments
 (0)