Skip to content

Fix version

Fix version #13

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Tests
on:
push:
branches: [ stable-dev ]
pull_request:
branches: [ stable-dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
test-arjdbc-mssql:
name: ARJDBC Tests (mssql)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ['jruby-9.4.2.0']
db: ['mssql']
test_targets: ['test_mssql']
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: Password12!
ports:
- 1433:1433
options: >-
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P \"Password12!\" -l 30 -Q \"SELECT 1\""
--health-start-period 10s
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
DB: ${{ matrix.db }}
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
SQLUSER: SA
SQLPASS: Password12!
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup database
run: /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -Q "CREATE DATABASE arjdbc_test;"
- name: Build
run: |
rake jar
- name: Run tests
run: |
bundle exec rake ${{ matrix.test_targets }}
test-rails-pgsql:
name: Rails Tests (Postgres)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [ 'jruby-9.4.2.0' ]
db: [ 'postgresql' ]
test_targets: [ "rails:test_postgresql" ]
ar_version: ["7-0-stable"]
prepared_statements: [ 'false', 'true' ]
services:
postgres:
image: postgres:10
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DB: ${{ matrix.db }}
AR_VERSION: ${{ matrix.ar_version }}
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
JDBC_SQLITE_VERSION: "3.32.3.3"
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup database
run: |
psql -c "create database activerecord_unittest;" -U postgres
psql -c "create database activerecord_unittest2;" -U postgres
- name: Build
run: |
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
- name: Run tests
run: |
bundle exec rake ${{ matrix.test_targets }}
test-arjdbc-pgsql:
name: ARJDBC Tests (Postgres)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ['jruby-9.4.2.0']
db: ['postgresql']
test_targets: ["db:postgresql test_postgresql"]
prepared_statements: ['false', 'true']
insert_returning: ['false', 'true']
services:
postgres:
image: postgres:10
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DB: ${{ matrix.db }}
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
INSERT_RETURNING: ${{ matrix.insert_returning }}
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build
run: |
rake jar
- name: Run tests
run: |
bundle exec rake ${{ matrix.test_targets }}