Skip to content

Commit

Permalink
Use Github Actions for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mlarraz committed Nov 23, 2022
1 parent c61e95c commit 07afd10
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 4 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby

source 'https://rubygems.org'

gemspec(path: '..')

gem 'activerecord', '~> 5.0.1'
gem 'activerecord', '~> 6.0.0'
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby

source 'https://rubygems.org'

gemspec(path: '..')

gem 'activerecord', '~> 5.1.0'
gem 'activerecord', '~> 6.1.0'
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby

source 'https://rubygems.org'

gemspec(path: '..')

gem 'activerecord', '~> 5.2.0'
gem 'activerecord', '~> 7.0.0'
2 changes: 1 addition & 1 deletion odbc_adapter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 07afd10

Please sign in to comment.