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 Apr 11, 2023
1 parent 45c67e9 commit b43554c
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 3 deletions.
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'

0 comments on commit b43554c

Please sign in to comment.