Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Github Actions for CI #9

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,68 @@ on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"
# - 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'