diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 43f97de9..b3ecf955 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -8,6 +8,67 @@ on: pull_request: jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - "2.7" + - "3.0" + # - head + activerecord: + - "6.0" + - "6.1" + - "7.0" + # - head + continue-on-error: ${{ matrix.ruby == 'head' || matrix.activerecord == 'head' }} + name: Ruby ${{ matrix.ruby }} / ActiveRecord ${{ matrix.activerecord }} + services: + postgres: + image: postgres:14 + ports: + - 5432:5432 + env: + POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_DB: odbc_test + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.activerecord }}.gemfile + steps: + - uses: actions/checkout@v2 + - name: Install Apt Packages + run: > + sudo apt-get install + unixodbc + unixodbc-dev + odbc-postgresql + odbcinst + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Setup PostgreSQL + run: | + export CONN_STR='DRIVER={PostgreSQL ANSI};SERVER=localhost;PORT=5432;DATABASE=odbc_test;UID=postgres;' + + sudo odbcinst -j + sudo cat /usr/share/psqlodbc/odbcinst.ini.template + + sudo odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template + - run: | + export CONN_STR='DRIVER={PostgreSQL ANSI};SERVER=localhost;PORT=5432;DATABASE=odbc_test;UID=postgres;' + bundle exec rake test + env: + PGHOST: localhost + PGUSER: postgres + MYSQL_HOST: 127.0.0.1 + RAILS_ENV: test RuboCop: runs-on: ubuntu-latest steps: diff --git a/gemfiles/active_record_5_0.gemfile b/gemfiles/activerecord_6.0.gemfile similarity index 50% rename from gemfiles/active_record_5_0.gemfile rename to gemfiles/activerecord_6.0.gemfile index 158e972a..d8be1295 100644 --- a/gemfiles/active_record_5_0.gemfile +++ b/gemfiles/activerecord_6.0.gemfile @@ -1,5 +1,7 @@ +#!/usr/bin/env ruby + source 'https://rubygems.org' gemspec(path: '..') -gem 'activerecord', '~> 5.0.1' +gem 'activerecord', '~> 6.0.0' diff --git a/gemfiles/active_record_5_1.gemfile b/gemfiles/activerecord_6.1.gemfile similarity index 50% rename from gemfiles/active_record_5_1.gemfile rename to gemfiles/activerecord_6.1.gemfile index 2c33e3ac..dab4a809 100644 --- a/gemfiles/active_record_5_1.gemfile +++ b/gemfiles/activerecord_6.1.gemfile @@ -1,5 +1,7 @@ +#!/usr/bin/env ruby + source 'https://rubygems.org' gemspec(path: '..') -gem 'activerecord', '~> 5.1.0' +gem 'activerecord', '~> 6.1.0' diff --git a/gemfiles/active_record_5_2.gemfile b/gemfiles/activerecord_7.0.gemfile similarity index 50% rename from gemfiles/active_record_5_2.gemfile rename to gemfiles/activerecord_7.0.gemfile index 4f1c5e9c..84a2be99 100644 --- a/gemfiles/active_record_5_2.gemfile +++ b/gemfiles/activerecord_7.0.gemfile @@ -1,5 +1,7 @@ +#!/usr/bin/env ruby + source 'https://rubygems.org' gemspec(path: '..') -gem 'activerecord', '~> 5.2.0' +gem 'activerecord', '~> 7.0.0' diff --git a/odbc_adapter.gemspec b/odbc_adapter.gemspec index d2e60e63..5551f1c3 100644 --- a/odbc_adapter.gemspec +++ b/odbc_adapter.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'activerecord', '>= 5.2', '< 8' + spec.add_dependency 'activerecord', '>= 6.0', '< 8' spec.add_dependency 'ruby-odbc', '~> 0.9' spec.add_development_dependency 'bundler', '>= 1.14'