From b43554cd5efefa75ab4cd5aedbef3139116f8a78 Mon Sep 17 00:00:00 2001 From: Matt Larraz Date: Wed, 13 Oct 2021 11:16:45 -0400 Subject: [PATCH] Use Github Actions for CI --- .github/workflows/CI.yml | 62 +++++++++++++++++++ ...d_5_0.gemfile => activerecord_6.0.gemfile} | 4 +- ...d_5_1.gemfile => activerecord_6.1.gemfile} | 4 +- ...d_5_2.gemfile => activerecord_7.0.gemfile} | 4 +- 4 files changed, 71 insertions(+), 3 deletions(-) rename gemfiles/{active_record_5_0.gemfile => activerecord_6.0.gemfile} (50%) rename gemfiles/{active_record_5_1.gemfile => activerecord_6.1.gemfile} (50%) rename gemfiles/{active_record_5_2.gemfile => activerecord_7.0.gemfile} (50%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 43f97de9..e1c31e8f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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: 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'