DEV: Introduce Zeitwerk reloading check in CI (#22151)
This should help us to catch the most catastrophic cases where plugins fail to auto-reload in development mode.
This commit is contained in:
parent
6e143c6157
commit
251d6f0627
|
@ -156,7 +156,7 @@ jobs:
|
|||
key: rspec-runtime-${{ matrix.build_type }}-${{ matrix.target }}-${{ github.run_id }}
|
||||
restore-keys: rspec-runtime-${{ matrix.build_type }}-${{ matrix.target }}-
|
||||
|
||||
- name: Run Zeitwerk check
|
||||
- name: Check Zeitwerk eager_load
|
||||
if: matrix.build_type == 'backend'
|
||||
env:
|
||||
LOAD_PLUGINS: ${{ (matrix.target == 'plugins') && '1' || '0' }}
|
||||
|
@ -172,6 +172,21 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check Zeitwerk reloading
|
||||
if: matrix.build_type == 'backend'
|
||||
env:
|
||||
LOAD_PLUGINS: ${{ (matrix.target == 'plugins') && '1' || '0' }}
|
||||
run: |
|
||||
if ! bin/rails runner 'Rails.application.reloader.reload!'; then
|
||||
echo
|
||||
echo "---------------------------------------------"
|
||||
echo
|
||||
echo "::error::Zeitwerk reload failed - the app will not be able to reload properly in development."
|
||||
echo "To reproduce locally, run \`bin/rails runner 'Rails.application.reloader.reload!'\`."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Core RSpec
|
||||
if: matrix.build_type == 'backend' && matrix.target == 'core'
|
||||
run: bin/turbo_rspec --use-runtime-info --verbose
|
||||
|
|
Loading…
Reference in New Issue