From 04cea824307e44226755412d2e06b685c93ae182 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sun, 16 Nov 2025 19:24:53 -1000 Subject: [PATCH 1/5] Modernize CI workflows with cleaner matrix configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor GitHub Actions workflows to use a simpler, more maintainable matrix configuration approach: - Replace complex include/exclude matrix logic with dynamic JSON arrays - Add determine-matrix step in detect-changes job to centralize matrix logic - Use translate-matrix step to convert dependency levels to Ruby/Node versions - Standardize approach across all workflows (examples, gem-tests, integration-tests, package-js-tests) - Add fail-fast: false to all matrix jobs for better CI visibility - Fix yalc command to use 'yarn yalc publish' for consistency - Remove Node 22 cache conditional (V8 bug appears to be resolved) This makes the CI configuration easier to understand and maintain while preserving the existing behavior of running latest versions on PRs and both latest+minimum on master. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/examples.yml | 52 +++++++------- .github/workflows/gem-tests.yml | 48 ++++++------- .github/workflows/integration-tests.yml | 93 ++++++++++++++----------- .github/workflows/package-js-tests.yml | 19 ++--- 4 files changed, 113 insertions(+), 99 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index c3e2e488c6..94e6a102d3 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -31,6 +31,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -40,6 +41,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -64,28 +73,8 @@ jobs: docs-only: ${{ steps.detect.outputs.docs_only }} previous-sha: ${{ github.event.before }} - setup-matrix: - needs: detect-changes - runs-on: ubuntu-22.04 - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - id: set-matrix - run: | - # Determine if we should run full matrix (master, workflow_dispatch, force_run, or full-ci label) - if [[ "${{ github.ref }}" == "refs/heads/master" ]] || \ - [[ "${{ github.event_name }}" == "workflow_dispatch" ]] || \ - [[ "${{ inputs.force_run }}" == "true" ]] || \ - [[ "${{ needs.detect-changes.outputs.has_full_ci_label }}" == "true" ]]; then - # Full matrix: test both latest and minimum supported versions - echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"},{"ruby-version":"3.2","dependency-level":"minimum"}]}' >> $GITHUB_OUTPUT - else - # PR matrix: test only latest versions for fast feedback - echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"}]}' >> $GITHUB_OUTPUT - fi - examples: - needs: [detect-changes, setup-matrix] + needs: detect-changes # Run on master, workflow_dispatch, OR when generators needed if: | !( @@ -99,19 +88,30 @@ jobs: ) strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} + matrix: + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} env: SKIP_YARN_COREPACK_CHECK: 0 BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Setup Node uses: actions/setup-node@v4 @@ -137,7 +137,7 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Install Node modules with Yarn for renderer package @@ -145,8 +145,6 @@ jobs: yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: yalc publish for react-on-rails - # Use yarn workspace script to publish all workspace packages to yalc - # Runs the "yalc:publish" script defined in each workspace's package.json run: yarn yalc publish - name: Install Ruby Gems for package run: | @@ -176,5 +174,5 @@ jobs: - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec diff --git a/.github/workflows/gem-tests.yml b/.github/workflows/gem-tests.yml index dd7a595d90..27f113137a 100644 --- a/.github/workflows/gem-tests.yml +++ b/.github/workflows/gem-tests.yml @@ -33,6 +33,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -42,6 +43,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -66,26 +75,8 @@ jobs: docs-only: ${{ steps.detect.outputs.docs_only }} previous-sha: ${{ github.event.before }} - setup-gem-tests-matrix: + basic-gem-tests: needs: detect-changes - runs-on: ubuntu-22.04 - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - id: set-matrix - run: | - # Determine if we should run full matrix (master or full-ci label) - if [[ "${{ github.ref }}" == "refs/heads/master" ]] || \ - [[ "${{ needs.detect-changes.outputs.has_full_ci_label }}" == "true" ]]; then - # Full matrix: test both latest and minimum supported versions - echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"},{"ruby-version":"3.2","dependency-level":"minimum"}]}' >> $GITHUB_OUTPUT - else - # PR matrix: test only latest versions for fast feedback - echo 'matrix={"include":[{"ruby-version":"3.4","dependency-level":"latest"}]}' >> $GITHUB_OUTPUT - fi - - rspec-package-tests: - needs: [detect-changes, setup-gem-tests-matrix] # Skip only if: master push AND docs-only changes # Otherwise run if: on master OR Ruby tests needed # This allows docs-only commits to skip heavy jobs while ensuring full CI on master for code changes @@ -100,18 +91,27 @@ jobs: ) strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup-gem-tests-matrix.outputs.matrix) }} + matrix: + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} env: BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Print system information run: | @@ -129,7 +129,7 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Ruby Gems for package run: bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3 - name: Git Stuff @@ -146,10 +146,10 @@ jobs: - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: log/test.log diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 5f96d2fd51..c892090657 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -32,6 +32,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -41,6 +42,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -64,28 +73,8 @@ jobs: docs-only: ${{ steps.detect.outputs.docs_only }} previous-sha: ${{ github.event.before }} - setup-integration-matrix: - needs: detect-changes - runs-on: ubuntu-22.04 - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - id: set-matrix - run: | - # Determine if we should run full matrix (master, workflow_dispatch, force_run, or full-ci label) - if [[ "${{ github.ref }}" == "refs/heads/master" ]] || \ - [[ "${{ github.event_name }}" == "workflow_dispatch" ]] || \ - [[ "${{ inputs.force_run }}" == "true" ]] || \ - [[ "${{ needs.detect-changes.outputs.has_full_ci_label }}" == "true" ]]; then - # Full matrix: test both latest and minimum supported versions - echo 'matrix={"include":[{"ruby-version":"3.4","node-version":"22","dependency-level":"latest"},{"ruby-version":"3.2","node-version":"20","dependency-level":"minimum"}]}' >> $GITHUB_OUTPUT - else - # PR matrix: test only latest versions for fast feedback - echo 'matrix={"include":[{"ruby-version":"3.4","node-version":"22","dependency-level":"latest"}]}' >> $GITHUB_OUTPUT - fi - build-dummy-app-webpack-test-bundles: - needs: [detect-changes, setup-integration-matrix] + needs: detect-changes # Skip only if: master push AND docs-only changes # Otherwise run if: on master OR workflow_dispatch OR dummy tests needed # This allows docs-only commits to skip heavy jobs while ensuring full CI on master for code changes @@ -100,16 +89,28 @@ jobs: needs.detect-changes.outputs.run_dummy_tests == 'true' ) strategy: - matrix: ${{ fromJson(needs.setup-integration-matrix.outputs.matrix) }} + fail-fast: false + matrix: + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 # libyaml-dev is needed for psych v5 # this gem depends on sdoc which depends on rdoc which depends on psych @@ -118,10 +119,10 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: ${{ matrix.node-version != '22' && 'yarn' || '' }} + cache: yarn cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -149,7 +150,7 @@ jobs: uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Ruby Gems for dummy app run: | cd spec/dummy @@ -167,10 +168,10 @@ jobs: uses: actions/cache/save@v4 with: path: spec/dummy/public/webpack - key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} dummy-app-integration-tests: - needs: [detect-changes, setup-integration-matrix, build-dummy-app-webpack-test-bundles] + needs: [detect-changes, build-dummy-app-webpack-test-bundles] # Run on master, workflow_dispatch, OR when tests needed on PR if: | !( @@ -183,24 +184,36 @@ jobs: needs.detect-changes.outputs.run_dummy_tests == 'true' ) strategy: - matrix: ${{ fromJson(needs.setup-integration-matrix.outputs.matrix) }} + fail-fast: false + matrix: + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Setup Node uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: ${{ matrix.node-version != '22' && 'yarn' || '' }} + cache: yarn cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -218,19 +231,19 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Save dummy app ruby gems to cache uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Save test Webpack bundles to cache (for build number checksum used by RSpec job) uses: actions/cache@v4 with: path: spec/dummy/public/webpack - key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Node modules with Yarn run: | yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} @@ -283,26 +296,26 @@ jobs: - run: cd spec/dummy && bundle info shakapacker - name: Set packer version environment variable run: | - echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV + echo "CI_DEPENDENCY_LEVEL=ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV - name: Main CI run: bundle exec rake run_rspec:all_dummy - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/tmp/capybara - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/log/test.log - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/yarn-error.log diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 5b9d3866b7..0df65e08b6 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -34,6 +34,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -43,6 +44,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"22\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"22\",\"20\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -80,15 +89,9 @@ jobs: needs.detect-changes.outputs.run_js_tests == 'true' ) strategy: + fail-fast: false matrix: - include: - # Always run: Latest Node version (fast feedback on PRs) - - node-version: '22' - # Master and full-ci label: Minimum supported Node version (full coverage) - - node-version: '20' - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label) - - node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }} + node-version: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From e0a7c70ba59dc57f65dd1023d82d4e155123507a Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sun, 16 Nov 2025 22:10:15 -1000 Subject: [PATCH 2/5] Fix inverted matrix logic in CI workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRITICAL FIX: The determine-matrix logic was backwards. Before: - master/force_run/full-ci → ["latest"] (only 1 config) - Regular PRs → ["latest","minimum"] (both configs) After (correct): - master/force_run/full-ci → ["latest","minimum"] (both configs) - Regular PRs → ["latest"] (only 1 config) This ensures: - PRs get fast feedback with latest dependencies only - Master and full CI runs test both latest AND minimum supported versions Affected workflows: - examples.yml - gem-tests.yml - integration-tests.yml - package-js-tests.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/examples.yml | 4 ++-- .github/workflows/package-js-tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 94e6a102d3..04fe71538b 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -45,9 +45,9 @@ jobs: id: determine-matrix run: | if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then - echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" - else echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" fi - name: Detect relevant changes id: detect diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 0df65e08b6..3491e3c1db 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -48,9 +48,9 @@ jobs: id: determine-matrix run: | if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then - echo "result=[\"22\"]" >> "$GITHUB_OUTPUT" - else echo "result=[\"22\",\"20\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"22\"]" >> "$GITHUB_OUTPUT" fi - name: Detect relevant changes id: detect From 1847c83a19a758458fbb5ab5285c93ef14bd2949 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sun, 16 Nov 2025 22:19:10 -1000 Subject: [PATCH 3/5] Update ci-rerun-failures to use new job name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update reference from 'rspec-package-tests' to 'basic-gem-tests' to match the renamed job in gem-tests.yml workflow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- bin/ci-rerun-failures | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ci-rerun-failures b/bin/ci-rerun-failures index 77e7febddf..437ad12cf0 100755 --- a/bin/ci-rerun-failures +++ b/bin/ci-rerun-failures @@ -177,7 +177,7 @@ fi # NOTE: Version numbers below must match .github/workflows/main.yml matrix configuration declare -A JOB_MAP JOB_MAP["lint-js-and-ruby"]="lint-js-and-ruby" -JOB_MAP["rspec-package-tests"]="rspec-package-tests" +JOB_MAP["basic-gem-tests"]="basic-gem-tests" JOB_MAP["package-js-tests"]="package-js-tests" JOB_MAP["dummy-app-integration-tests (3.4, 22, latest)"]="dummy-app-integration-tests" JOB_MAP["dummy-app-integration-tests (3.2, 20, minimum)"]="dummy-app-integration-tests" @@ -190,7 +190,7 @@ run_command() { "lint-js-and-ruby") bundle exec rubocop && yarn run eslint --report-unused-disable-directives && yarn start format.listDifferent ;; - "rspec-package-tests") + "basic-gem-tests") bundle exec rake run_rspec:gem ;; "package-js-tests") From 402b17b886c20d3d36bf5c1abb5dd3caebf4528c Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Mon, 17 Nov 2025 15:13:01 -1000 Subject: [PATCH 4/5] Restore conditional cache disabling for Node 22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Preserve the original behavior from master where yarn cache is disabled for Node 22 due to V8 bug in 22.21.0 (nodejs/node#56010). Before: cache: yarn (always enabled) After: cache: ${{ steps.translate-matrix.outputs.node-version != '22' && 'yarn' || '' }} This ensures Node 22 runs without cache while Node 20 uses cache as intended. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c892090657..02a1177c00 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -122,7 +122,7 @@ jobs: node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: yarn + cache: ${{ steps.translate-matrix.outputs.node-version != '22' && 'yarn' || '' }} cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -213,7 +213,7 @@ jobs: node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: yarn + cache: ${{ steps.translate-matrix.outputs.node-version != '22' && 'yarn' || '' }} cache-dependency-path: '**/yarn.lock' - name: Print system information run: | From dfb2cafeaf9ac7c148792491ff030a274113ffd0 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Tue, 18 Nov 2025 15:08:50 -1000 Subject: [PATCH 5/5] Fix hardcoded Node version and restore yalc command consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Critical fixes: 1. Use translated node-version from matrix instead of hardcoded '20' - Latest config will now correctly use Node 22 instead of Node 20 2. Restore yalc command to match other workflows: 'cd packages/react-on-rails && yalc publish' 3. Re-enable conditional yarn cache (disabled for Node 22 due to V8 bug) This ensures the matrix actually controls which Node version is used. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/examples.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 04fe71538b..5436a38ad9 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -116,11 +116,11 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 20 - # TODO: Re-enable yarn caching once Node.js V8 cache crash is fixed - # Tracking: https://github.com/actions/setup-node/issues/1028 - # cache: yarn - # cache-dependency-path: '**/yarn.lock' + node-version: ${{ steps.translate-matrix.outputs.node-version }} + # Disable cache for Node 22 due to V8 bug in 22.21.0 + # https://github.com/nodejs/node/issues/56010 + cache: ${{ steps.translate-matrix.outputs.node-version != '22' && 'yarn' || '' }} + cache-dependency-path: '**/yarn.lock' - name: Print system information run: | echo "Linux release: "; cat /etc/issue @@ -145,7 +145,7 @@ jobs: yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: yalc publish for react-on-rails - run: yarn yalc publish + run: cd packages/react-on-rails && yalc publish - name: Install Ruby Gems for package run: | bundle lock --add-platform 'x86_64-linux'