From 7bf752568fe80b509188ca2c2d9227edbcb1dc11 Mon Sep 17 00:00:00 2001 From: Ben Sheldon Date: Fri, 5 Mar 2021 08:01:10 -0800 Subject: [PATCH] Fix appraisal and bundler version CI conflicts --- .github/workflows/test.yml | 51 +++++++++++--------------------------- Gemfile | 1 + Gemfile.lock | 17 +++++++++---- good_job.gemspec | 1 - 4 files changed, 28 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 157d4f6f1..05f36b24b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -54,7 +37,10 @@ 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 @@ -62,6 +48,7 @@ jobs: BUNDLE_JOBS: 4 BUNDLE_RETRY: 3 BUNDLE_PATH: vendor/bundle + BUNDLE_WITHOUT: "lint" DISABLE_SPRING: 1 services: postgres: @@ -77,6 +64,8 @@ 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!) @@ -84,28 +73,18 @@ jobs: - 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() diff --git a/Gemfile b/Gemfile index 964b6b26c..5256cebeb 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index 06cb54ea5..c050f8fbc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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: @@ -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) @@ -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) @@ -333,7 +340,7 @@ PLATFORMS DEPENDENCIES activerecord-jdbcpostgresql-adapter - appraisal + appraisal! capybara database_cleaner dotenv diff --git a/good_job.gemspec b/good_job.gemspec index e04d6466f..3e14429d3 100644 --- a/good_job.gemspec +++ b/good_job.gemspec @@ -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"