Skip to content

Commit

Permalink
Merge pull request #224 from bensheldon/cleanup_bundler
Browse files Browse the repository at this point in the history
Fix appraisal and bundler version CI conflicts
  • Loading branch information
bensheldon authored Mar 12, 2021
2 parents cf4c6cb + 7db33b3 commit ca8526c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 46 deletions.
55 changes: 15 additions & 40 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,12 @@ jobs:
uses: actions/checkout@v2

# Dependencies
- name: Install missing libs (This is slated to be added to the base image soon!)
run: sudo apt-get -yqq install libpq-dev
- name: "Set Ruby version"
id: ruby_version
run: echo "::set-output name=value::$(cat .ruby-version)"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ steps.ruby_version.outputs.value }}
bundler: none
- name: Ruby gem cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: v1-bundler-${{ runner.os }}-${{ steps.ruby_version.outputs.value }}-${{ hashFiles('**/good_job.gemspec') }}-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/Appraisals') }}
restore-keys: |
v1-bundler-${{ runner.os }}-${{ steps.ruby_version.outputs.value }}-
- name: Install bundler
run: gem update --system && gem install bundler -v $(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -1 | tr -d " ")
- name: Install Gemfile gems
run: bundle install
- name: Install Appraisal gems
run: bundle exec appraisal install --path $BUNDLE_PATH
# /Dependencies
bundler-cache: true

# Lint
- name: Run linter
run: bin/lint --nofix

Expand All @@ -54,14 +35,18 @@ jobs:
strategy:
matrix:
ruby: [2.5, 2.6, 2.7, 3.0, jruby-9.2.13.0, jruby-9.2.14.0]
pg: [12.5, 10.8]
pg: [12.5]
include:
- ruby: 2.7
pg: 10.8
env:
PGHOST: localhost
PGUSER: test_app
RAILS_ENV: test
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
BUNDLE_WITHOUT: "lint"
DISABLE_SPRING: 1
services:
postgres:
Expand All @@ -77,35 +62,25 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update .ruby-version with matrix value
run: echo "${{ matrix.ruby }}" >| .ruby-version

# Dependencies
- name: Install missing libs (This is slated to be added to the base image soon!)
run: sudo apt-get -yqq install libpq-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
- name: Ruby gem cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: v1-bundler-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('**/good_job.gemspec') }}-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/Appraisals') }}
restore-keys: |
v1-bundler-${{ runner.os }}-${{ matrix.ruby }}-
- name: Install bundler
run: gem update --system && gem install bundler --default -v $(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -1 | tr -d " ")
- name: Install Gemfile gems
run: bundle install --without lint
bundler-cache: true
- name: Install Appraisal gems
run: bundle exec appraisal install --without lint --path $BUNDLE_PATH
# /Dependencies
run: bundle exec appraisal install

# Test
- name: Set up test database
run: bin/rails db:test:prepare
working-directory: spec/test_app
- name: Run tests
run: bundle exec appraisal bin/rspec
run: bundle exec appraisal rspec

# Archive
- name: Archive system spec screenshots
uses: actions/upload-artifact@v2
if: failure()
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gemspec
# your gem to rubygems.org.

gem 'activerecord-jdbcpostgresql-adapter', platforms: [:jruby]
gem 'appraisal', github: "excid3/appraisal", branch: "fix-bundle-env" # https://github.com/thoughtbot/appraisal/pull/174
gem 'pg', platforms: [:mri, :mingw, :x64_mingw]
gem 'rails'

Expand Down
17 changes: 12 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
GIT
remote: https://github.com/excid3/appraisal.git
revision: 8bb003b273ae074356dc67b59ecc67c8ae2f3a27
branch: fix-bundle-env
specs:
appraisal (2.3.0)
bundler
rake
thor (>= 0.14.0)

PATH
remote: .
specs:
Expand Down Expand Up @@ -78,10 +88,6 @@ GEM
zeitwerk (~> 2.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
appraisal (2.4.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
better_html (1.0.16)
actionview (>= 4.0)
Expand Down Expand Up @@ -177,6 +183,7 @@ GEM
mixlib-shellout (3.2.5)
chef-utils
msgpack (1.4.2)
msgpack (1.4.2-java)
multi_json (1.15.0)
multipart-post (2.1.1)
nio4r (2.5.5)
Expand Down Expand Up @@ -333,7 +340,7 @@ PLATFORMS

DEPENDENCIES
activerecord-jdbcpostgresql-adapter
appraisal
appraisal!
capybara
database_cleaner
dotenv
Expand Down
1 change: 0 additions & 1 deletion good_job.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "thor", ">= 0.14.1"
spec.add_dependency "zeitwerk", ">= 2.0"

spec.add_development_dependency "appraisal"
spec.add_development_dependency "capybara"
spec.add_development_dependency "database_cleaner"
spec.add_development_dependency "dotenv"
Expand Down

0 comments on commit ca8526c

Please sign in to comment.