diff --git a/.github/workflows/ruby.yml b/.github/workflows/ci.yml similarity index 56% rename from .github/workflows/ruby.yml rename to .github/workflows/ci.yml index 9fd8dc50..9a12ece2 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Ruby specs +name: CI on: push: @@ -11,153 +11,128 @@ permissions: jobs: test: - name: Ruby specs + name: Ruby ${{ matrix.ruby-version }}, ${{ matrix.gemfile }}, PG ${{ matrix.postgres-version }} runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '3.0', '3.1'] - gemfile: ['rails_3.2', 'rails_4.0', 'rails_4.1', 'rails_4.2', 'rails_5.0', 'rails_5.1', 'rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0', 'rails_7.1', 'rails_7.2'] + ruby-version: ['3.1'] + gemfile: [rails_6.1] + postgres-version: ['12'] - exclude: + include: - ruby-version: '2.1' - gemfile: rails_5.0 - - ruby-version: '2.1' - gemfile: rails_5.1 - - ruby-version: '2.1' - gemfile: rails_5.2 - - ruby-version: '2.1' - gemfile: rails_6.0 - - ruby-version: '2.1' - gemfile: rails_6.1 + gemfile: rails_3.2 + postgres-version: 10 - ruby-version: '2.1' - gemfile: rails_7.0 + gemfile: rails_4.0 + postgres-version: 10 - ruby-version: '2.1' - gemfile: rails_7.1 + gemfile: rails_4.1 + postgres-version: 10 - ruby-version: '2.1' - gemfile: rails_7.2 + gemfile: rails_4.2 + postgres-version: 12 - ruby-version: '2.2' - gemfile: rails_6.0 + gemfile: rails_3.2 + postgres-version: 10 - ruby-version: '2.2' - gemfile: rails_6.1 + gemfile: rails_4.0 + postgres-version: 10 + - ruby-version: '2.2' + gemfile: rails_4.1 + postgres-version: 10 + - ruby-version: '2.2' + gemfile: rails_4.2 + postgres-version: 12 - ruby-version: '2.2' - gemfile: rails_7.0 + gemfile: rails_5.0 + postgres-version: 12 - ruby-version: '2.2' - gemfile: rails_7.1 + gemfile: rails_5.1 + postgres-version: 12 - ruby-version: '2.2' - gemfile: rails_7.2 + gemfile: rails_5.2 + postgres-version: 12 - ruby-version: '2.3' - gemfile: rails_4.0 - - ruby-version: '2.3' - gemfile: rails_4.1 - - ruby-version: '2.3' - gemfile: rails_6.0 + gemfile: rails_3.2 + postgres-version: 10 - ruby-version: '2.3' - gemfile: rails_6.1 + gemfile: rails_4.2 + postgres-version: 12 - ruby-version: '2.3' - gemfile: rails_7.0 + gemfile: rails_5.0 + postgres-version: 12 - ruby-version: '2.3' - gemfile: rails_7.1 + gemfile: rails_5.1 + postgres-version: 12 - ruby-version: '2.3' - gemfile: rails_7.2 + gemfile: rails_5.2 + postgres-version: 12 - ruby-version: '2.4' - gemfile: rails_3.2 - - ruby-version: '2.4' - gemfile: rails_4.0 - - ruby-version: '2.4' - gemfile: rails_4.1 - - ruby-version: '2.4' - gemfile: rails_6.0 - - ruby-version: '2.4' - gemfile: rails_6.1 + gemfile: rails_4.2 + postgres-version: 12 - ruby-version: '2.4' - gemfile: rails_7.0 + gemfile: rails_5.0 + postgres-version: 12 - ruby-version: '2.4' - gemfile: rails_7.1 + gemfile: rails_5.1 + postgres-version: 12 - ruby-version: '2.4' - gemfile: rails_7.2 + gemfile: rails_5.2 + postgres-version: 12 - ruby-version: '2.5' - gemfile: rails_3.2 - - ruby-version: '2.5' - gemfile: rails_4.0 - - ruby-version: '2.5' - gemfile: rails_4.1 + gemfile: rails_5.0 + postgres-version: 12 - ruby-version: '2.5' - gemfile: rails_4.2 + gemfile: rails_5.1 + postgres-version: 12 - ruby-version: '2.5' - gemfile: rails_7.0 + gemfile: rails_5.2 + postgres-version: 12 - ruby-version: '2.5' - gemfile: rails_7.1 + gemfile: rails_6.0 + postgres-version: 12 - ruby-version: '2.5' - gemfile: rails_7.2 + gemfile: rails_6.1 + postgres-version: 12 - ruby-version: '2.6' - gemfile: rails_3.2 - - ruby-version: '2.6' - gemfile: rails_4.0 - - ruby-version: '2.6' - gemfile: rails_4.1 + gemfile: rails_5.0 + postgres-version: 12 - ruby-version: '2.6' - gemfile: rails_4.2 + gemfile: rails_5.1 + postgres-version: 12 - ruby-version: '2.6' - gemfile: rails_7.0 + gemfile: rails_5.2 + postgres-version: 12 - ruby-version: '2.6' - gemfile: rails_7.1 + gemfile: rails_6.0 + postgres-version: 12 - ruby-version: '2.6' - gemfile: rails_7.2 + gemfile: rails_6.1 + postgres-version: 12 - ruby-version: '2.7' - gemfile: rails_3.2 - - ruby-version: '2.7' - gemfile: rails_4.0 - - ruby-version: '2.7' - gemfile: rails_4.1 - - ruby-version: '2.7' - gemfile: rails_4.2 - - ruby-version: '2.7' - gemfile: rails_5.0 + gemfile: rails_5.2 + postgres-version: 12 - ruby-version: '2.7' - gemfile: rails_5.1 + gemfile: rails_6.0 + postgres-version: 12 - ruby-version: '2.7' - gemfile: rails_5.2 + gemfile: rails_6.1 + postgres-version: 12 - ruby-version: '3.0' - gemfile: rails_3.2 - - ruby-version: '3.0' - gemfile: rails_4.0 - - ruby-version: '3.0' - gemfile: rails_4.1 - - ruby-version: '3.0' - gemfile: rails_4.2 - - ruby-version: '3.0' - gemfile: rails_5.0 - - ruby-version: '3.0' - gemfile: rails_5.1 - - ruby-version: '3.0' - gemfile: rails_5.2 - - ruby-version: '3.0' - gemfile: rails_7.2 - - - ruby-version: '3.1' - gemfile: rails_3.2 - - ruby-version: '3.1' - gemfile: rails_4.0 - - ruby-version: '3.1' - gemfile: rails_4.1 - - ruby-version: '3.1' - gemfile: rails_4.2 - - ruby-version: '3.1' - gemfile: rails_5.0 - - ruby-version: '3.1' - gemfile: rails_5.1 - - ruby-version: '3.1' - gemfile: rails_5.2 - - ruby-version: '3.1' gemfile: rails_6.0 + postgres-version: 12 + - ruby-version: '3.0' + gemfile: rails_6.1 + postgres-version: 12 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile @@ -166,6 +141,11 @@ jobs: steps: - uses: actions/checkout@v6 + - uses: ankane/setup-postgres@v1 + with: + postgres-version: ${{ matrix.postgres-version }} + database: eaco + - name: Decide RubyGems id: setup-params run: | @@ -193,6 +173,10 @@ jobs: bundler-cache: true rubygems: ${{ steps.setup-params.outputs.version }} - - name: Run specs + - name: Run Specs + run: | + bundle exec rspec + + - name: Run Cucumber features run: | - bundle exec rake spec + bundle exec cucumber -f pretty diff --git a/.gitignore b/.gitignore index 5221f81c..dfdea9c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,66 @@ *.gem *.rbc -.bundle -.config -.yardoc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +# Ignore Byebug command history file. +.byebug_history + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: Gemfile.lock -gemfiles/*.gemfile.lock -_yardoc -coverage -doc/ +.ruby-version +.ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# Used by RuboCop. Remote config files pulled in from inherit_from directive. +# .rubocop-https?--* + +# Custom +gemfiles/*.lock +gemfiles/.bundle +gemfiles/vendor +spec/config.yml +spec/debug.log + features/active_record.yml features/active_record.log -lib/bundler/man -pkg -rdoc -tmp -*.bundle -*.so -*.o -*.a -mkmf.log diff --git a/Appraisals b/Appraisals index da9c798b..5c9b211a 100644 --- a/Appraisals +++ b/Appraisals @@ -18,24 +18,29 @@ appraise 'rails-4.1' do end appraise 'rails-4.2' do + gem 'bigdecimal', '< 2' + gem 'loofah', '~> 2.20.0' gem 'rails', '~> 4.2.0' gem 'pg', '~> 0.21' gem 'term-ansicolor', '~> 1.7.0' end appraise 'rails-5.0' do + gem 'loofah', '~> 2.20.0' gem 'rails', '~> 5.0.0' gem 'pg', '~> 0.21' gem 'term-ansicolor', '~> 1.7.0' end appraise 'rails-5.1' do + gem 'loofah', '~> 2.20.0' gem 'rails', '~> 5.1.0' gem 'pg', '~> 0.21' gem 'term-ansicolor', '~> 1.7.0' end appraise 'rails-5.2' do + gem 'loofah', '~> 2.20.0' gem 'rails', '~> 5.2.0' gem 'term-ansicolor', '~> 1.7.0' end diff --git a/README.md b/README.md index 9c26fd21..5e4b40ac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Eaco -[![Ruby specs](https://github.com/ifad/eaco/actions/workflows/ruby.yml/badge.svg)](https://github.com/ifad/eaco/actions/workflows/ruby.yml) +[![CI](https://github.com/ifad/eaco/actions/workflows/ci.yml/badge.svg)](https://github.com/ifad/eaco/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/ifad/eaco/badge.svg)](https://coveralls.io/github/ifad/eaco) [![Maintainability](https://qlty.sh/gh/ifad/projects/eaco/maintainability.svg)](https://qlty.sh/gh/ifad/projects/eaco) [![Inline docs](https://inch-ci.org/github/ifad/eaco.svg?branch=master)](https://inch-ci.org/github/ifad/eaco) @@ -227,8 +227,7 @@ Run `rake`. This will run the specs and cucumber features and report coverage. Specs are run against the supported rails versions in turn. If you want to focus on a single release, use `appraisal rails-X.Y rake`, where `X.Y` can be -`3.2`, `4.0`, `4.1`, `4.2`, `5.0`, `5.1`, `5.2`, `6.0`, `6.1`, `7.0`, `7.1`, -or `7.2`. +`3.2`, `4.0`, `4.1`, `4.2`, `5.0`, `5.1`, `5.2`, `6.0`, and `6.1`. ## Contributing diff --git a/gemfiles/rails_4.2.gemfile b/gemfiles/rails_4.2.gemfile index 0247ad6a..9ad0c05a 100644 --- a/gemfiles/rails_4.2.gemfile +++ b/gemfiles/rails_4.2.gemfile @@ -2,6 +2,8 @@ source "https://rubygems.org" +gem "bigdecimal", "< 2" +gem "loofah", "~> 2.20.0" gem "rails", "~> 4.2.0" gem "pg", "~> 0.21" gem "term-ansicolor", "~> 1.7.0" diff --git a/gemfiles/rails_5.0.gemfile b/gemfiles/rails_5.0.gemfile index 98c8fbb9..e485333a 100644 --- a/gemfiles/rails_5.0.gemfile +++ b/gemfiles/rails_5.0.gemfile @@ -2,6 +2,7 @@ source "https://rubygems.org" +gem "loofah", "~> 2.20.0" gem "rails", "~> 5.0.0" gem "pg", "~> 0.21" gem "term-ansicolor", "~> 1.7.0" diff --git a/gemfiles/rails_5.1.gemfile b/gemfiles/rails_5.1.gemfile index 18bc3a8b..d88dddcb 100644 --- a/gemfiles/rails_5.1.gemfile +++ b/gemfiles/rails_5.1.gemfile @@ -2,6 +2,7 @@ source "https://rubygems.org" +gem "loofah", "~> 2.20.0" gem "rails", "~> 5.1.0" gem "pg", "~> 0.21" gem "term-ansicolor", "~> 1.7.0" diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile index edea7e0f..4b79e2a0 100644 --- a/gemfiles/rails_5.2.gemfile +++ b/gemfiles/rails_5.2.gemfile @@ -2,6 +2,7 @@ source "https://rubygems.org" +gem "loofah", "~> 2.20.0" gem "rails", "~> 5.2.0" gem "term-ansicolor", "~> 1.7.0"