Skip to content

Commit

Permalink
Merge pull request #682 from eregon/bundler-cache
Browse files Browse the repository at this point in the history
Use bundler-cache: true to automatically cache installed gems
  • Loading branch information
coorasse authored Mar 14, 2021
2 parents e9ca4ef + 5196dfb commit 81869f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Test & lint
on: [push]
on: [push, pull_request]

env:
RAILS_ENV: test
Expand All @@ -19,6 +19,8 @@ jobs:
exclude:
- gemfile: 'gemfiles/activerecord_4.2.0.gemfile'
ruby: '2.7' # rails 4.2 can't run on ruby 2.7 due to BigDecimal API change
- gemfile: 'gemfiles/activerecord_4.2.0.gemfile'
ruby: '2.7' # TruffleRuby 21.0 targets Ruby 2.7, same as above
- gemfile: 'gemfiles/activerecord_6.0.0.gemfile'
ruby: '2.4' # rails 6+ requires ruby 2.5+
- gemfile: 'gemfiles/activerecord_6.1.0.gemfile'
Expand Down Expand Up @@ -55,21 +57,16 @@ jobs:
with:
fetch-depth: '20'

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Install bundler
run: gem install bundler

# https://github.com/CanCanCommunity/cancancan/pull/669#issuecomment-748019539
- name: Nokogiri support for Truffleruby
run: sudo apt-get -yqq install libxml2-dev libxslt-dev
if: ${{ matrix.ruby == 'truffleruby' }}

- name: Install gems
run: bundle install --jobs 2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run linter
run: bundle exec rubocop
Expand Down
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ AllCops:
TargetRubyVersion: 2.2.0
Exclude:
- 'gemfiles/**/*'
- 'vendor/**/*'
- 'Appraisals'

0 comments on commit 81869f9

Please sign in to comment.