Skip to content

Commit

Permalink
Merge pull request #48 from DFE-Digital/appraisals
Browse files Browse the repository at this point in the history
Run specs on multiple Rails versions
  • Loading branch information
duncanjbrown authored Sep 20, 2022
2 parents 5ad04af + 2fd7a03 commit 2cd7cd3
Show file tree
Hide file tree
Showing 15 changed files with 1,171 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
name: Run specs
strategy:
matrix:
ruby-version: ['2.7']
ruby-version: ['2.7', '3.1']
rails-version: ['rails-6', 'rails-6.1', 'rails-7']
env:
BUNDLE_WITHOUT: release
steps:
Expand All @@ -24,11 +25,11 @@ jobs:
bundler-cache: true
- name: Run rspec
run: |
bundle exec appraisal install
cd spec/dummy
bundle
bundle exec rails db:test:prepare
cd ../..
bundle exec rspec
bundle exec appraisal ${{ matrix.rails-version }} rspec
lint:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ AllCops:
Exclude:
- 'spec/dummy/db/schema.rb'
- 'vendor/**/*' # necesssary because GH actions puts gems in here
- 'gemfiles/*'
- 'Appraisals'
12 changes: 12 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appraise "rails-6" do
gem "rails", "6.0.6"
gem 'psych', '< 4'
end

appraise "rails-6.1" do
gem "rails", "6.1.7"
end

appraise "rails-7" do
gem "rails", "7.0.4"
end
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
async (2.0.0)
console (~> 1.10)
Expand Down Expand Up @@ -360,6 +364,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
appraisal
debug (>= 1.0.0)
dfe-analytics!
gem-release
Expand Down
1 change: 1 addition & 0 deletions dfe-analytics.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'google-cloud-bigquery', '~> 1.38'
spec.add_dependency 'request_store_rails', '~> 2'

spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'debug', '>= 1.0.0'
spec.add_development_dependency 'gem-release', '~> 2.2'
spec.add_development_dependency 'github_changelog_generator', '~> 1.16'
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_RETRY: "1"
12 changes: 12 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "6.1.7"

group :release do
gem "gem-release", require: false
gem "github_changelog_generator", require: false
end

gemspec path: "../"
Loading

0 comments on commit 2cd7cd3

Please sign in to comment.