diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 157d4f6f1..6d0be487c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,29 +21,20 @@ 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" + - name: Set Ruby version id: ruby_version run: echo "::set-output name=value::$(cat .ruby-version)" + - name: Set Bundler version + id: bundler_version + run: echo "::set-output name=value::$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -1 | tr -d " ")" - 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: ${{ steps.bundler_version.outputs.value }} + bundler-cache: true + # Lint - name: Run linter run: bin/lint --nofix @@ -53,8 +44,11 @@ jobs: timeout-minutes: 15 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] + ruby: 2.5, 2.6, 2.7, 3.0, jruby-9.2.13.0, jruby-9.2.14.0] + pg: [12.5] + include: + - ruby: 2.7 + pg: 10.8 env: PGHOST: localhost PGUSER: test_app @@ -62,6 +56,7 @@ jobs: BUNDLE_JOBS: 4 BUNDLE_RETRY: 3 BUNDLE_PATH: vendor/bundle + BUNDLE_WITHOUT: "lint" DISABLE_SPRING: 1 services: postgres: @@ -81,31 +76,26 @@ 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 Bundler version + id: bundler_version + run: echo "::set-output name=value::$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -1 | tr -d " ")" - 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: ${{ steps.bundler_version.outputs.value }} + bundler-cache: true - name: Install Appraisal gems - run: bundle exec appraisal install --without lint --path $BUNDLE_PATH - # /Dependencies + run: bundle exec appraisal install --without $BUNDLE_WITHOUT --path $BUNDLE_PATH + # 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"