|
69 | 69 | run: |
|
70 | 70 | bundle exec rake ${{ matrix.test_targets }}
|
71 | 71 |
|
| 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 | +
|
72 | 122 | test-rails-sqlite:
|
73 | 123 |
|
74 | 124 | name: Rails Tests (SQLite)
|
@@ -146,6 +196,53 @@ jobs:
|
146 | 196 | run: |
|
147 | 197 | bundle exec rake ${{ matrix.test_targets }}
|
148 | 198 |
|
| 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 | +
|
149 | 246 | test-arjdbc-sqlite:
|
150 | 247 |
|
151 | 248 | name: ARJDBC Tests (SQLite)
|
|
0 commit comments