@@ -64,24 +64,28 @@ jobs:
6464 if : |
6565 github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true'
6666 strategy :
67+ fail-fast : false
6768 matrix :
68- ruby-version : ['3.4']
69- node-version : ['22']
70- dependency-level : ['latest']
71- include :
72- # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
73- - ruby-version : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}}
74- node-version : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}}
75- dependency-level : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}}
69+ dependency-level : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}}
7670 runs-on : ubuntu-22.04
7771 steps :
72+ - name : Translate matrix for Ruby and Node versions
73+ id : translate-matrix
74+ run : |
75+ if [ "${{ matrix.dependency-level }}" == "latest" ]; then
76+ echo "ruby-version=3.4" >> "$GITHUB_OUTPUT"
77+ echo "node-version=22" >> "$GITHUB_OUTPUT"
78+ else
79+ echo "ruby-version=3.2" >> "$GITHUB_OUTPUT"
80+ echo "node-version=20" >> "$GITHUB_OUTPUT"
81+ fi
7882 - uses : actions/checkout@v4
7983 with :
8084 persist-credentials : false
8185 - name : Setup Ruby
8286 uses : ruby/setup-ruby@v1
8387 with :
84- ruby-version : ${{ matrix.ruby-version }}
88+ ruby-version : ${{ steps.translate- matrix.outputs .ruby-version }}
8589 bundler : 2.5.9
8690 # libyaml-dev is needed for psych v5
8791 # this gem depends on sdoc which depends on rdoc which depends on psych
@@ -90,10 +94,10 @@ jobs:
9094 - name : Setup Node
9195 uses : actions/setup-node@v4
9296 with :
93- node-version : ${{ matrix.node-version }}
97+ node-version : ${{ steps.translate- matrix.outputs .node-version }}
9498 # Disable cache for Node 22 due to V8 bug in 22.21.0
9599 # https://github.com/nodejs/node/issues/56010
96- cache : ${{ matrix.node-version != '22' && ' yarn' || '' }}
100+ cache : yarn
97101 cache-dependency-path : ' **/yarn.lock'
98102 - name : Print system information
99103 run : |
@@ -121,7 +125,7 @@ jobs:
121125 uses : actions/cache@v4
122126 with :
123127 path : spec/dummy/vendor/bundle
124- key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
128+ key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
125129 - name : Install Ruby Gems for dummy app
126130 run : |
127131 cd spec/dummy
@@ -139,45 +143,44 @@ jobs:
139143 uses : actions/cache/save@v4
140144 with :
141145 path : spec/dummy/public/webpack
142- key : dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
146+ key : dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
143147
144148 spec-dummy-integration-tests :
145149 needs : [detect-changes, build-dummy-app-webpack-test-bundles]
146150 # Run on master, workflow_dispatch, OR when tests needed on PR
147151 if : |
148152 github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true'
149153 strategy :
154+ fail-fast : false
150155 matrix :
151- ruby-version : ['3.4']
152- node-version : ['22']
153- dependency-level : ['latest']
154- include :
155- # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
156- - ruby-version : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}}
157- node-version : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}}
158- dependency-level : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}}
159- exclude :
160- # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
161- - ruby-version : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
162- node-version : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }}
163- dependency-level : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
156+ dependency-level : ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}}
164157 runs-on : ubuntu-22.04
165158 steps :
159+ - name : Translate matrix for Ruby and Node versions
160+ id : translate-matrix
161+ run : |
162+ if [ "${{ matrix.dependency-level }}" == "latest" ]; then
163+ echo "ruby-version=3.4" >> "$GITHUB_OUTPUT"
164+ echo "node-version=22" >> "$GITHUB_OUTPUT"
165+ else
166+ echo "ruby-version=3.2" >> "$GITHUB_OUTPUT"
167+ echo "node-version=20" >> "$GITHUB_OUTPUT"
168+ fi
166169 - uses : actions/checkout@v4
167170 with :
168171 persist-credentials : false
169172 - name : Setup Ruby
170173 uses : ruby/setup-ruby@v1
171174 with :
172- ruby-version : ${{ matrix.ruby-version }}
175+ ruby-version : ${{ steps.translate- matrix.outputs .ruby-version }}
173176 bundler : 2.5.9
174177 - name : Setup Node
175178 uses : actions/setup-node@v4
176179 with :
177- node-version : ${{ matrix.node-version }}
180+ node-version : ${{ steps.translate- matrix.outputs .node-version }}
178181 # Disable cache for Node 22 due to V8 bug in 22.21.0
179182 # https://github.com/nodejs/node/issues/56010
180- cache : ${{ matrix.node-version != '22' && ' yarn' || '' }}
183+ cache : yarn
181184 cache-dependency-path : ' **/yarn.lock'
182185 - name : Print system information
183186 run : |
@@ -195,19 +198,19 @@ jobs:
195198 uses : actions/cache@v4
196199 with :
197200 path : vendor/bundle
198- key : package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
201+ key : package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
199202 - name : Save dummy app ruby gems to cache
200203 uses : actions/cache@v4
201204 with :
202205 path : spec/dummy/vendor/bundle
203- key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
206+ key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
204207 - id : get-sha
205208 run : echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
206209 - name : Save test Webpack bundles to cache (for build number checksum used by RSpec job)
207210 uses : actions/cache@v4
208211 with :
209212 path : spec/dummy/public/webpack
210- key : dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
213+ key : dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
211214 - name : Install Node modules with Yarn
212215 run : |
213216 yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
@@ -260,26 +263,26 @@ jobs:
260263 - run : cd spec/dummy && bundle info shakapacker
261264 - name : Set packer version environment variable
262265 run : |
263- echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV
266+ echo "CI_DEPENDENCY_LEVEL=ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV
264267 - name : Main CI
265268 run : bundle exec rake run_rspec:all_dummy
266269 - name : Store test results
267270 uses : actions/upload-artifact@v4
268271 with :
269- name : main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
272+ name : main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
270273 path : ~/rspec
271274 - name : Store artifacts
272275 uses : actions/upload-artifact@v4
273276 with :
274- name : dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
277+ name : dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
275278 path : spec/dummy/tmp/capybara
276279 - name : Store artifacts
277280 uses : actions/upload-artifact@v4
278281 with :
279- name : dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
282+ name : dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
280283 path : spec/dummy/log/test.log
281284 - name : Store artifacts
282285 uses : actions/upload-artifact@v4
283286 with :
284- name : dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
287+ name : dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate- matrix.outputs .ruby-version }}-${{ matrix.dependency-level }}
285288 path : spec/dummy/yarn-error.log
0 commit comments