@@ -52,35 +52,26 @@ jobs:
5252 - ruby-version : ' 3.2'
5353 node-version : ' 20'
5454 dependency-level : ' minimum'
55+ exclude :
56+ # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch)
57+ - ruby-version : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '3.2' || '' }}
58+ node-version : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '20' || '' }}
59+ dependency-level : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && 'minimum' || '' }}
5560 runs-on : ubuntu-22.04
56- env :
57- # Skip minimum dependency on regular PRs (only run on master or workflow_dispatch)
58- SKIP_MINIMUM : ${{ matrix.dependency-level == 'minimum' && github.event_name != 'workflow_dispatch' && github.ref != 'refs/heads/master' }}
5961 steps :
60- - name : Check if job should skip
61- if : env.SKIP_MINIMUM == 'true'
62- run : |
63- echo "Skipping minimum dependency run on regular PR"
64- echo "Use /run-skipped-ci command to run all versions"
65- exit 0
66-
6762 - uses : actions/checkout@v4
68- if : env.SKIP_MINIMUM != 'true'
6963 with :
7064 persist-credentials : false
7165 - name : Setup Ruby
72- if : env.SKIP_MINIMUM != 'true'
7366 uses : ruby/setup-ruby@v1
7467 with :
7568 ruby-version : ${{ matrix.ruby-version }}
7669 bundler : 2.5.9
7770 # libyaml-dev is needed for psych v5
7871 # this gem depends on sdoc which depends on rdoc which depends on psych
7972 - name : Fix dependency for libyaml-dev
80- if : env.SKIP_MINIMUM != 'true'
8173 run : sudo apt install libyaml-dev
8274 - name : Setup Node
83- if : env.SKIP_MINIMUM != 'true'
8475 uses : actions/setup-node@v4
8576 with :
8677 node-version : ${{ matrix.node-version }}
8980 cache : ${{ matrix.node-version != '22' && 'yarn' || '' }}
9081 cache-dependency-path : ' **/yarn.lock'
9182 - name : Print system information
92- if : env.SKIP_MINIMUM != 'true'
9383 run : |
9484 echo "Linux release: "; cat /etc/issue
9585 echo "Current user: "; whoami
@@ -102,43 +92,34 @@ jobs:
10292 if : matrix.dependency-level == 'minimum'
10393 run : script/convert
10494 - name : Install Node modules with Yarn for renderer package
105- if : env.SKIP_MINIMUM != 'true'
10695 run : |
10796 yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
10897 sudo yarn global add yalc
10998 - name : yalc publish for react-on-rails
110- if : env.SKIP_MINIMUM != 'true'
11199 run : cd packages/react-on-rails && yalc publish
112100 - name : yalc add react-on-rails
113- if : env.SKIP_MINIMUM != 'true'
114101 run : cd spec/dummy && yalc add react-on-rails
115102 - name : Install Node modules with Yarn for dummy app
116- if : env.SKIP_MINIMUM != 'true'
117103 run : cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
118104 - name : Save dummy app ruby gems to cache
119- if : env.SKIP_MINIMUM != 'true'
120105 uses : actions/cache@v4
121106 with :
122107 path : spec/dummy/vendor/bundle
123108 key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
124109 - name : Install Ruby Gems for dummy app
125- if : env.SKIP_MINIMUM != 'true'
126110 run : |
127111 cd spec/dummy
128112 bundle lock --add-platform 'x86_64-linux'
129113 if ! bundle check --path=vendor/bundle; then
130114 bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
131115 fi
132116 - name : generate file system-based packs
133- if : env.SKIP_MINIMUM != 'true'
134117 run : cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs
135118 - name : Build test bundles for dummy app
136- if : env.SKIP_MINIMUM != 'true'
137119 run : cd spec/dummy && rm -rf public/webpack/test && yarn run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/shakapacker
138120 - id : get-sha
139121 run : echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
140122 - name : Save test Webpack bundles to cache (for build number checksum used by RSpec job)
141- if : env.SKIP_MINIMUM != 'true'
142123 uses : actions/cache/save@v4
143124 with :
144125 path : spec/dummy/public/webpack
@@ -147,13 +128,8 @@ jobs:
147128 dummy-app-integration-tests :
148129 needs : [detect-changes, build-dummy-app-webpack-test-bundles]
149130 # Run on master, workflow_dispatch, OR when tests needed on PR
150- # For regular PRs: only run latest versions
151131 if : |
152132 github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true'
153- # For master/workflow_dispatch: run all versions
154- if : |
155- (github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true') &&
156- (matrix.dependency-level != 'minimum' || github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch')
157133 strategy :
158134 fail-fast : false
159135 matrix :
@@ -166,23 +142,22 @@ jobs:
166142 - ruby-version : ' 3.2'
167143 node-version : ' 20'
168144 dependency-level : ' minimum'
145+ exclude :
146+ # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch)
147+ - ruby-version : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '3.2' || '' }}
148+ node-version : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '20' || '' }}
149+ dependency-level : ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && 'minimum' || '' }}
169150 runs-on : ubuntu-22.04
170- env :
171- # Skip minimum dependency on regular PRs (only run on master or workflow_dispatch)
172- SKIP_MINIMUM : ${{ matrix.dependency-level == 'minimum' && github.event_name != 'workflow_dispatch' && github.ref != 'refs/heads/master' }}
173151 steps :
174152 - uses : actions/checkout@v4
175- if : env.SKIP_MINIMUM != 'true'
176153 with :
177154 persist-credentials : false
178155 - name : Setup Ruby
179- if : env.SKIP_MINIMUM != 'true'
180156 uses : ruby/setup-ruby@v1
181157 with :
182158 ruby-version : ${{ matrix.ruby-version }}
183159 bundler : 2.5.9
184160 - name : Setup Node
185- if : env.SKIP_MINIMUM != 'true'
186161 uses : actions/setup-node@v4
187162 with :
188163 node-version : ${{ matrix.node-version }}
@@ -191,7 +166,6 @@ jobs:
191166 cache : ${{ matrix.node-version != '22' && 'yarn' || '' }}
192167 cache-dependency-path : ' **/yarn.lock'
193168 - name : Print system information
194- if : env.SKIP_MINIMUM != 'true'
195169 run : |
196170 echo "Linux release: "; cat /etc/issue
197171 echo "Current user: "; whoami
@@ -204,61 +178,50 @@ jobs:
204178 if : matrix.dependency-level == 'minimum'
205179 run : script/convert
206180 - name : Save root ruby gems to cache
207- if : env.SKIP_MINIMUM != 'true'
208181 uses : actions/cache@v4
209182 with :
210183 path : vendor/bundle
211184 key : package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
212185 - name : Save dummy app ruby gems to cache
213- if : env.SKIP_MINIMUM != 'true'
214186 uses : actions/cache@v4
215187 with :
216188 path : spec/dummy/vendor/bundle
217189 key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
218190 - id : get-sha
219191 run : echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
220192 - name : Save test Webpack bundles to cache (for build number checksum used by RSpec job)
221- if : env.SKIP_MINIMUM != 'true'
222193 uses : actions/cache@v4
223194 with :
224195 path : spec/dummy/public/webpack
225196 key : dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
226197 - name : Install Node modules with Yarn
227- if : env.SKIP_MINIMUM != 'true'
228198 run : |
229199 yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
230200 sudo yarn global add yalc
231201 - name : yalc publish for react-on-rails
232- if : env.SKIP_MINIMUM != 'true'
233202 run : cd packages/react-on-rails && yalc publish
234203 - name : yalc add react-on-rails
235- if : env.SKIP_MINIMUM != 'true'
236204 run : cd spec/dummy && yalc add react-on-rails
237205 - name : Install Node modules with Yarn for dummy app
238- if : env.SKIP_MINIMUM != 'true'
239206 run : cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
240207 - name : Dummy JS tests
241- if : env.SKIP_MINIMUM != 'true'
242208 run : |
243209 cd spec/dummy
244210 yarn run test:js
245211 - name : Install Ruby Gems for package
246- if : env.SKIP_MINIMUM != 'true'
247212 run : |
248213 bundle lock --add-platform 'x86_64-linux'
249214 if ! bundle check --path=vendor/bundle; then
250215 bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
251216 fi
252217 - name : Install Ruby Gems for dummy app
253- if : env.SKIP_MINIMUM != 'true'
254218 run : |
255219 cd spec/dummy
256220 bundle lock --add-platform 'x86_64-linux'
257221 if ! bundle check --path=vendor/bundle; then
258222 bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
259223 fi
260224 - name : Ensure minimum required Chrome version
261- if : env.SKIP_MINIMUM != 'true'
262225 run : |
263226 echo -e "Already installed $(google-chrome --version)\n"
264227 MINIMUM_REQUIRED_CHROME_VERSION=75
@@ -271,10 +234,8 @@ jobs:
271234 echo -e "\nInstalled $(google-chrome --version)"
272235 fi
273236 - name : Increase the amount of inotify watchers
274- if : env.SKIP_MINIMUM != 'true'
275237 run : echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
276238 - name : generate file system-based packs
277- if : env.SKIP_MINIMUM != 'true'
278239 run : cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs
279240 - name : Git Stuff
280241 if : matrix.dependency-level == 'minimum'
@@ -284,32 +245,26 @@ jobs:
284245 git commit -am "stop generators from complaining about uncommitted code"
285246 - run : cd spec/dummy && bundle info shakapacker
286247 - name : Set packer version environment variable
287- if : env.SKIP_MINIMUM != 'true'
288248 run : |
289249 echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV
290250 - name : Main CI
291- if : env.SKIP_MINIMUM != 'true'
292251 run : bundle exec rake run_rspec:all_dummy
293252 - name : Store test results
294- if : env.SKIP_MINIMUM != 'true'
295253 uses : actions/upload-artifact@v4
296254 with :
297255 name : main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
298256 path : ~/rspec
299257 - name : Store artifacts
300- if : env.SKIP_MINIMUM != 'true'
301258 uses : actions/upload-artifact@v4
302259 with :
303260 name : dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
304261 path : spec/dummy/tmp/capybara
305262 - name : Store artifacts
306- if : env.SKIP_MINIMUM != 'true'
307263 uses : actions/upload-artifact@v4
308264 with :
309265 name : dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
310266 path : spec/dummy/log/test.log
311267 - name : Store artifacts
312- if : env.SKIP_MINIMUM != 'true'
313268 uses : actions/upload-artifact@v4
314269 with :
315270 name : dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
0 commit comments