3939 build-dummy-app-webpack-test-bundles :
4040 needs : detect-changes
4141 # Run on master, workflow_dispatch, OR when tests needed on PR
42- # For regular PRs: only run latest versions
43- # For master/workflow_dispatch: run all versions
4442 if : |
45- (github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true') &&
46- (matrix.dependency-level != 'minimum' || github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch')
43+ github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true'
4744 strategy :
4845 matrix :
4946 include :
@@ -56,20 +53,34 @@ jobs:
5653 node-version : ' 20'
5754 dependency-level : ' minimum'
5855 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' }}
5959 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+
6067 - uses : actions/checkout@v4
68+ if : env.SKIP_MINIMUM != 'true'
6169 with :
6270 persist-credentials : false
6371 - name : Setup Ruby
72+ if : env.SKIP_MINIMUM != 'true'
6473 uses : ruby/setup-ruby@v1
6574 with :
6675 ruby-version : ${{ matrix.ruby-version }}
6776 bundler : 2.5.9
6877 # libyaml-dev is needed for psych v5
6978 # this gem depends on sdoc which depends on rdoc which depends on psych
7079 - name : Fix dependency for libyaml-dev
80+ if : env.SKIP_MINIMUM != 'true'
7181 run : sudo apt install libyaml-dev
7282 - name : Setup Node
83+ if : env.SKIP_MINIMUM != 'true'
7384 uses : actions/setup-node@v4
7485 with :
7586 node-version : ${{ matrix.node-version }}
7889 cache : ${{ matrix.node-version != '22' && 'yarn' || '' }}
7990 cache-dependency-path : ' **/yarn.lock'
8091 - name : Print system information
92+ if : env.SKIP_MINIMUM != 'true'
8193 run : |
8294 echo "Linux release: "; cat /etc/issue
8395 echo "Current user: "; whoami
@@ -90,34 +102,43 @@ jobs:
90102 if : matrix.dependency-level == 'minimum'
91103 run : script/convert
92104 - name : Install Node modules with Yarn for renderer package
105+ if : env.SKIP_MINIMUM != 'true'
93106 run : |
94107 yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
95108 sudo yarn global add yalc
96109 - name : yalc publish for react-on-rails
110+ if : env.SKIP_MINIMUM != 'true'
97111 run : cd packages/react-on-rails && yalc publish
98112 - name : yalc add react-on-rails
113+ if : env.SKIP_MINIMUM != 'true'
99114 run : cd spec/dummy && yalc add react-on-rails
100115 - name : Install Node modules with Yarn for dummy app
116+ if : env.SKIP_MINIMUM != 'true'
101117 run : cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
102118 - name : Save dummy app ruby gems to cache
119+ if : env.SKIP_MINIMUM != 'true'
103120 uses : actions/cache@v4
104121 with :
105122 path : spec/dummy/vendor/bundle
106123 key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
107124 - name : Install Ruby Gems for dummy app
125+ if : env.SKIP_MINIMUM != 'true'
108126 run : |
109127 cd spec/dummy
110128 bundle lock --add-platform 'x86_64-linux'
111129 if ! bundle check --path=vendor/bundle; then
112130 bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
113131 fi
114132 - name : generate file system-based packs
133+ if : env.SKIP_MINIMUM != 'true'
115134 run : cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs
116135 - name : Build test bundles for dummy app
136+ if : env.SKIP_MINIMUM != 'true'
117137 run : cd spec/dummy && rm -rf public/webpack/test && yarn run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/shakapacker
118138 - id : get-sha
119139 run : echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
120140 - name : Save test Webpack bundles to cache (for build number checksum used by RSpec job)
141+ if : env.SKIP_MINIMUM != 'true'
121142 uses : actions/cache/save@v4
122143 with :
123144 path : spec/dummy/public/webpack
@@ -127,6 +148,8 @@ jobs:
127148 needs : [detect-changes, build-dummy-app-webpack-test-bundles]
128149 # Run on master, workflow_dispatch, OR when tests needed on PR
129150 # For regular PRs: only run latest versions
151+ if : |
152+ github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true'
130153 # For master/workflow_dispatch: run all versions
131154 if : |
132155 (github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true') &&
@@ -144,16 +167,22 @@ jobs:
144167 node-version : ' 20'
145168 dependency-level : ' minimum'
146169 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' }}
147173 steps :
148174 - uses : actions/checkout@v4
175+ if : env.SKIP_MINIMUM != 'true'
149176 with :
150177 persist-credentials : false
151178 - name : Setup Ruby
179+ if : env.SKIP_MINIMUM != 'true'
152180 uses : ruby/setup-ruby@v1
153181 with :
154182 ruby-version : ${{ matrix.ruby-version }}
155183 bundler : 2.5.9
156184 - name : Setup Node
185+ if : env.SKIP_MINIMUM != 'true'
157186 uses : actions/setup-node@v4
158187 with :
159188 node-version : ${{ matrix.node-version }}
@@ -162,6 +191,7 @@ jobs:
162191 cache : ${{ matrix.node-version != '22' && 'yarn' || '' }}
163192 cache-dependency-path : ' **/yarn.lock'
164193 - name : Print system information
194+ if : env.SKIP_MINIMUM != 'true'
165195 run : |
166196 echo "Linux release: "; cat /etc/issue
167197 echo "Current user: "; whoami
@@ -174,50 +204,61 @@ jobs:
174204 if : matrix.dependency-level == 'minimum'
175205 run : script/convert
176206 - name : Save root ruby gems to cache
207+ if : env.SKIP_MINIMUM != 'true'
177208 uses : actions/cache@v4
178209 with :
179210 path : vendor/bundle
180211 key : package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
181212 - name : Save dummy app ruby gems to cache
213+ if : env.SKIP_MINIMUM != 'true'
182214 uses : actions/cache@v4
183215 with :
184216 path : spec/dummy/vendor/bundle
185217 key : dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
186218 - id : get-sha
187219 run : echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
188220 - name : Save test Webpack bundles to cache (for build number checksum used by RSpec job)
221+ if : env.SKIP_MINIMUM != 'true'
189222 uses : actions/cache@v4
190223 with :
191224 path : spec/dummy/public/webpack
192225 key : dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
193226 - name : Install Node modules with Yarn
227+ if : env.SKIP_MINIMUM != 'true'
194228 run : |
195229 yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
196230 sudo yarn global add yalc
197231 - name : yalc publish for react-on-rails
232+ if : env.SKIP_MINIMUM != 'true'
198233 run : cd packages/react-on-rails && yalc publish
199234 - name : yalc add react-on-rails
235+ if : env.SKIP_MINIMUM != 'true'
200236 run : cd spec/dummy && yalc add react-on-rails
201237 - name : Install Node modules with Yarn for dummy app
238+ if : env.SKIP_MINIMUM != 'true'
202239 run : cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
203240 - name : Dummy JS tests
241+ if : env.SKIP_MINIMUM != 'true'
204242 run : |
205243 cd spec/dummy
206244 yarn run test:js
207245 - name : Install Ruby Gems for package
246+ if : env.SKIP_MINIMUM != 'true'
208247 run : |
209248 bundle lock --add-platform 'x86_64-linux'
210249 if ! bundle check --path=vendor/bundle; then
211250 bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
212251 fi
213252 - name : Install Ruby Gems for dummy app
253+ if : env.SKIP_MINIMUM != 'true'
214254 run : |
215255 cd spec/dummy
216256 bundle lock --add-platform 'x86_64-linux'
217257 if ! bundle check --path=vendor/bundle; then
218258 bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
219259 fi
220260 - name : Ensure minimum required Chrome version
261+ if : env.SKIP_MINIMUM != 'true'
221262 run : |
222263 echo -e "Already installed $(google-chrome --version)\n"
223264 MINIMUM_REQUIRED_CHROME_VERSION=75
@@ -230,8 +271,10 @@ jobs:
230271 echo -e "\nInstalled $(google-chrome --version)"
231272 fi
232273 - name : Increase the amount of inotify watchers
274+ if : env.SKIP_MINIMUM != 'true'
233275 run : echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
234276 - name : generate file system-based packs
277+ if : env.SKIP_MINIMUM != 'true'
235278 run : cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs
236279 - name : Git Stuff
237280 if : matrix.dependency-level == 'minimum'
@@ -241,26 +284,32 @@ jobs:
241284 git commit -am "stop generators from complaining about uncommitted code"
242285 - run : cd spec/dummy && bundle info shakapacker
243286 - name : Set packer version environment variable
287+ if : env.SKIP_MINIMUM != 'true'
244288 run : |
245289 echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV
246290 - name : Main CI
291+ if : env.SKIP_MINIMUM != 'true'
247292 run : bundle exec rake run_rspec:all_dummy
248293 - name : Store test results
294+ if : env.SKIP_MINIMUM != 'true'
249295 uses : actions/upload-artifact@v4
250296 with :
251297 name : main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
252298 path : ~/rspec
253299 - name : Store artifacts
300+ if : env.SKIP_MINIMUM != 'true'
254301 uses : actions/upload-artifact@v4
255302 with :
256303 name : dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
257304 path : spec/dummy/tmp/capybara
258305 - name : Store artifacts
306+ if : env.SKIP_MINIMUM != 'true'
259307 uses : actions/upload-artifact@v4
260308 with :
261309 name : dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
262310 path : spec/dummy/log/test.log
263311 - name : Store artifacts
312+ if : env.SKIP_MINIMUM != 'true'
264313 uses : actions/upload-artifact@v4
265314 with :
266315 name : dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
0 commit comments