From 86820eee25e428f7e667bf9529b97c32e6575d9b Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Tue, 18 Jun 2024 18:09:40 -0700 Subject: [PATCH] Use bundler-cache to bundle install and cache gems The setup-ruby action makes it trivial to bundle install gems from a cache and update the cache when the run completes. When using `bundler-cache`, we can't use `bundle config` commands, but we can achieve the same effect specifying BUNDLE_SET as an env variable. See https://github.com/ruby/setup-ruby for details --- .github/workflows/rspec_tests.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rspec_tests.yaml b/.github/workflows/rspec_tests.yaml index ce509ec5f91..72f722918f1 100644 --- a/.github/workflows/rspec_tests.yaml +++ b/.github/workflows/rspec_tests.yaml @@ -24,6 +24,8 @@ jobs: - {os: windows-2019, ruby: '3.2'} # openssl 3 runs-on: ${{ matrix.cfg.os }} + env: + BUNDLE_SET: "without packaging documentation" steps: - name: Checkout current PR uses: actions/checkout@v4 @@ -32,12 +34,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.cfg.ruby }} - - - name: Update rubygems and install gems - run: | - gem update --system --silent --no-document - bundle config set without packaging documentation - bundle install --jobs 4 --retry 3 + bundler-cache: true - name: Run tests on Windows if: runner.os == 'Windows'