Skip to content

Commit

Permalink
Fix appraisal and bundler version CI conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon committed Mar 12, 2021
1 parent 32b2ffa commit 7bf7525
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 42 deletions.
51 changes: 15 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,12 @@ jobs:
# 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 +37,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 +64,27 @@ 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 7bf7525

Please sign in to comment.