From 3b738124415674fc8bc1f3c480a756097d6d4569 Mon Sep 17 00:00:00 2001 From: Grant Hutchins Date: Fri, 22 May 2026 15:04:20 -0500 Subject: [PATCH 1/4] Drop bundle update step from CI matrix Previously the matrix prepended ACTIVE_RECORD_VERSION (or ACTIVE_RECORD_BRANCH) onto a separate `bundle update` step because setup-ruby's bundler-cache install ran before those env vars were in scope. The cached install resolved the gemspec's default ActiveRecord, so a follow-up `bundle update` was needed to swap in the matrix's chosen version. Write the matrix's KEY=value to $GITHUB_ENV in a step that runs before setup-ruby instead. The cached install now resolves the right gems on the first try, and cache-version partitions the bundler cache per matrix entry so different ActiveRecord versions don't collide. --- .github/workflows/ci.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2952dca2..5efbd540 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,40 +37,43 @@ jobs: fail-fast: false matrix: ruby-version: ["3.3", "3.4", "4.0"] - active-record-version-env: - - ACTIVE_RECORD_VERSION="~> 7.2.0" - - ACTIVE_RECORD_VERSION="~> 8.0.0" - - ACTIVE_RECORD_VERSION="~> 8.1.0" + active-record-env: + - "ACTIVE_RECORD_VERSION=~> 7.2.0" + - "ACTIVE_RECORD_VERSION=~> 8.0.0" + - "ACTIVE_RECORD_VERSION=~> 8.1.0" allow-failure: [false] include: - ruby-version: "ruby-head" - active-record-version-env: ACTIVE_RECORD_VERSION="~> 8.1.0" + active-record-env: "ACTIVE_RECORD_VERSION=~> 8.1.0" allow-failure: true - ruby-version: "4.0" - active-record-version-env: ACTIVE_RECORD_BRANCH="main" + active-record-env: "ACTIVE_RECORD_BRANCH=main" allow-failure: true - ruby-version: "4.0" - active-record-version-env: ACTIVE_RECORD_BRANCH="8-1-stable" + active-record-env: "ACTIVE_RECORD_BRANCH=8-1-stable" allow-failure: true - ruby-version: "4.0" - active-record-version-env: ACTIVE_RECORD_BRANCH="8-0-stable" + active-record-env: "ACTIVE_RECORD_BRANCH=8-0-stable" allow-failure: true - ruby-version: "4.0" - active-record-version-env: ACTIVE_RECORD_BRANCH="7-2-stable" + active-record-env: "ACTIVE_RECORD_BRANCH=7-2-stable" allow-failure: true continue-on-error: ${{ matrix.allow-failure }} steps: - uses: actions/checkout@v6 + - name: Select ActiveRecord version + env: + ACTIVE_RECORD_ENV: ${{ matrix.active-record-env }} + run: echo "$ACTIVE_RECORD_ENV" >> "$GITHUB_ENV" - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true + cache-version: ${{ matrix.active-record-env }} - name: Set up test database env: PGPASSWORD: postgres run: createdb pg_search_test - - name: Update bundle - run: ${{ matrix.active-record-version-env }} bundle update - name: Run tests - run: ${{ matrix.active-record-version-env }} bundle exec rake + run: bundle exec rake From 6d3fbedcf2dcb843c4121c16b399e1f447094349 Mon Sep 17 00:00:00 2001 From: Grant Hutchins Date: Fri, 22 May 2026 15:07:01 -0500 Subject: [PATCH 2/4] Give CI matrix jobs readable names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub renders matrix job names from raw axis values by default, so runs showed up as `test (3.3, ACTIVE_RECORD_VERSION=~> 7.2.0, false)` — readable only after squinting. Group the ActiveRecord axis into an object with a short `label` and a `env` payload, then set the job `name:` to `Ruby /