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 Appraisal in CI #1230

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 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
24 changes: 14 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,32 @@ jobs:
bundle exec rake translatable_benchmark
bundle exec rake slotable_benchmark
test:
name: test (Rails ${{ matrix.rails_version }}, Ruby ${{ matrix.ruby_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rails_version: ['5.2.6', '6.0.4.4', '6.1.4.4', '7.0.1', 'main']
rails_version: ['5.2', '6.0', '6.1', '7.0', 'main']
ruby_version: ['2.5', '2.6', '2.7', '3.0', '3.1']
exclude:
- rails_version: '5.2.6'
- rails_version: '5.2'
ruby_version: '3.0'
- rails_version: '5.2.6'
- rails_version: '5.2'
ruby_version: '3.1'
- rails_version: '6.0.4.4'
- rails_version: '6.0'
ruby_version: '3.0'
- rails_version: '6.0.4.4'
- rails_version: '6.0'
ruby_version: '3.1'
- rails_version: '7.0.1'
- rails_version: '7.0'
ruby_version: '2.5'
- rails_version: '7.0.1'
- rails_version: '7.0'
ruby_version: '2.6'
- rails_version: 'main'
ruby_version: '2.5'
- rails_version: 'main'
ruby_version: '2.6'
env:
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails_version }}.gemfile
steps:
- uses: actions/checkout@master
- name: Setup Ruby
Expand All @@ -55,12 +58,13 @@ jobs:
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-build-rails-${{ matrix.rails_version }}-ruby-${{ matrix.ruby_version }}-${{ hashFiles('**/Gemfile.lock') }}
key: gems-build-rails-${{ matrix.rails_version }}-ruby-${{ matrix.ruby_version }}-${{ hashFiles('**/gemfiles/rails_${{ matrix.rails_version }}.gemfile.lock') }}
Copy link
Collaborator Author

@Spone Spone Jan 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this works as expected. 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this part probably works alright. I'm inclined to believe it's setting BUNDLE_GEMFILE that isn't doing anything.

if caching was failing but the Gemfile was fine, GitHub Actions would try to install turbo-rails. I'm inclined to believe setting the Gemfile doesn't work, but caching still does, because there's no mention of turbo-rails or tailwindcss-rails in the logs, and the logs still say they're using a gem that has already been downloaded.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tailwindcss-rails now appear in the logs of the latest runs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like the call to hashFiles is returning anything.

- name: Build and test with Rake
run: |
bundle config path vendor/bundle
bundle update
bundle exec rake
bundle
bundle exec appraisal rails-${{ matrix.rails_version }} bundle
bundle exec appraisal rails-${{ matrix.rails_version }} rake
env:
MEASURE_COVERAGE: true
RAILS_VERSION: ${{ matrix.rails_version }}
Expand Down
2 changes: 1 addition & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ appraise "rails-7.0" do
gem "tailwindcss-rails", "~> 2.0"
end

appraise "rails-head" do
appraise "rails-main" do
gem "rails", github: "rails/rails", branch: "main"
gem "tailwindcss-rails", "~> 2.0"
end
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ rails_version = "#{ENV['RAILS_VERSION'] || 'main'}"
gem "capybara", "~> 3"
gem "rails", rails_version == "main" ? { git: "https://github.com/rails/rails", ref: "main" } : rails_version

group :development, :test do
gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we shouldn't be using thoughtbot/appraisal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because the fix we need is not yet merged: thoughtbot/appraisal#174

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way we can keep tabs on where @excid3's fork is at to ensure it's not susceptible to upstream issues with Appraisal?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI, I am skipping appraisal in CI right now and just setting BUNDLE_GEMFILE via matrix.

https://github.com/excid3/noticed/blob/master/.github/workflows/ci.yml#L28

end

if RUBY_VERSION >= "3.1"
gem "net-imap", require: false
gem "net-pop", require: false
Expand Down
137 changes: 70 additions & 67 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,85 +1,91 @@
GIT
remote: https://github.com/excid3/appraisal.git
revision: 14855fc54ce88b42def871ce8bfd4259fbf06043
branch: fix-bundle-env
specs:
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)

PATH
remote: .
specs:
view_component (2.48.0)
view_component (2.49.0)
activesupport (>= 5.0.0, < 8.0)
method_source (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
actioncable (7.0.2.2)
actionpack (= 7.0.2.2)
activesupport (= 7.0.2.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
actionmailbox (7.0.2.2)
actionpack (= 7.0.2.2)
activejob (= 7.0.2.2)
activerecord (= 7.0.2.2)
activestorage (= 7.0.2.2)
activesupport (= 7.0.2.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.1)
actionpack (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activesupport (= 7.0.1)
actionmailer (7.0.2.2)
actionpack (= 7.0.2.2)
actionview (= 7.0.2.2)
activejob (= 7.0.2.2)
activesupport (= 7.0.2.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.1)
actionview (= 7.0.1)
activesupport (= 7.0.1)
actionpack (7.0.2.2)
actionview (= 7.0.2.2)
activesupport (= 7.0.2.2)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.1)
actionpack (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
actiontext (7.0.2.2)
actionpack (= 7.0.2.2)
activerecord (= 7.0.2.2)
activestorage (= 7.0.2.2)
activesupport (= 7.0.2.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.1)
activesupport (= 7.0.1)
actionview (7.0.2.2)
activesupport (= 7.0.2.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.1)
activesupport (= 7.0.1)
activejob (7.0.2.2)
activesupport (= 7.0.2.2)
globalid (>= 0.3.6)
activemodel (7.0.1)
activesupport (= 7.0.1)
activerecord (7.0.1)
activemodel (= 7.0.1)
activesupport (= 7.0.1)
activestorage (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activesupport (= 7.0.1)
activemodel (7.0.2.2)
activesupport (= 7.0.2.2)
activerecord (7.0.2.2)
activemodel (= 7.0.2.2)
activesupport (= 7.0.2.2)
activestorage (7.0.2.2)
actionpack (= 7.0.2.2)
activejob (= 7.0.2.2)
activerecord (= 7.0.2.2)
activesupport (= 7.0.2.2)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.1)
activesupport (7.0.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
benchmark-ips (2.8.4)
better_html (1.0.16)
Expand Down Expand Up @@ -120,13 +126,13 @@ GEM
temple (>= 0.8.0)
tilt
html_tokenizer (0.0.7)
i18n (1.8.11)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
io-wait (0.2.1)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
loofah (2.13.0)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand Down Expand Up @@ -167,35 +173,35 @@ GEM
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.1)
actioncable (= 7.0.1)
actionmailbox (= 7.0.1)
actionmailer (= 7.0.1)
actionpack (= 7.0.1)
actiontext (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activemodel (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
rails (7.0.2.2)
actioncable (= 7.0.2.2)
actionmailbox (= 7.0.2.2)
actionmailer (= 7.0.2.2)
actionpack (= 7.0.2.2)
actiontext (= 7.0.2.2)
actionview (= 7.0.2.2)
activejob (= 7.0.2.2)
activemodel (= 7.0.2.2)
activerecord (= 7.0.2.2)
activestorage (= 7.0.2.2)
activesupport (= 7.0.2.2)
bundler (>= 1.15.0)
railties (= 7.0.1)
railties (= 7.0.2.2)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
railties (7.0.2.2)
actionpack (= 7.0.2.2)
activesupport (= 7.0.2.2)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.2.0)
regexp_parser (2.2.1)
rexml (3.2.5)
rubocop (1.13.0)
parallel (~> 1.10)
Expand All @@ -206,7 +212,7 @@ GEM
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
rubocop-ast (1.15.2)
parser (>= 3.0.1.1)
rubocop-github (0.16.2)
rubocop (<= 1.13.0)
Expand Down Expand Up @@ -259,13 +265,13 @@ GEM
webrick (~> 1.7.0)
yard-activesupport-concern (0.0.1)
yard (>= 0.8)
zeitwerk (2.5.3)
zeitwerk (2.5.4)

PLATFORMS
ruby

DEPENDENCIES
appraisal (~> 2.4)
appraisal!
benchmark-ips (~> 2.8.2)
better_html (~> 1)
bundler (>= 1.15.0)
Expand All @@ -274,9 +280,6 @@ DEPENDENCIES
haml (~> 5)
jbuilder (~> 2)
minitest (= 5.6.0)
net-imap
net-pop
net-smtp
pry (~> 0.13)
rails (~> 7.0.0)
rake (~> 13.0)
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ title: Changelog

## main

* Update CI configuration to use `Appraisal`.

*Hans Lemuet*

* Fix Ruby warnings.

*Hans Lemuet*
Expand Down
4 changes: 4 additions & 0 deletions gemfiles/rails_5.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ source "https://rubygems.org"
gem "capybara", "~> 3"
gem "rails", "~> 5.2.0"

group :development, :test do
gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
end

gemspec path: "../"
4 changes: 4 additions & 0 deletions gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ gem "capybara", "~> 3"
gem "rails", "~> 6.0.0"
gem "tailwindcss-rails", "~> 2.0"

group :development, :test do
gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
end

gemspec path: "../"
4 changes: 4 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ gem "net-smtp", require: false
gem "net-imap", require: false
gem "net-pop", require: false

group :development, :test do
gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
end

gemspec path: "../"
4 changes: 4 additions & 0 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ gem "capybara", "~> 3"
gem "rails", "~> 7.0.0"
gem "tailwindcss-rails", "~> 2.0"

group :development, :test do
gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
end

gemspec path: "../"
4 changes: 4 additions & 0 deletions gemfiles/rails_head.gemfile → gemfiles/rails_main.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ gem "capybara", "~> 3"
gem "rails", github: "rails/rails", branch: "main"
gem "tailwindcss-rails", "~> 2.0"

group :development, :test do
gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
end

gemspec path: "../"