mirror of
https://github.com/discourse/discourse.git
synced 2025-03-27 10:17:24 +08:00
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
17
.github/workflows/tests.yml
vendored
17
.github/workflows/tests.yml
vendored
@ -156,7 +156,7 @@ jobs:
|
|||||||
key: rspec-runtime-${{ matrix.build_type }}-${{ matrix.target }}-${{ github.run_id }}
|
key: rspec-runtime-${{ matrix.build_type }}-${{ matrix.target }}-${{ github.run_id }}
|
||||||
restore-keys: rspec-runtime-${{ matrix.build_type }}-${{ matrix.target }}-
|
restore-keys: rspec-runtime-${{ matrix.build_type }}-${{ matrix.target }}-
|
||||||
|
|
||||||
- name: Run Zeitwerk check
|
- name: Check Zeitwerk eager_load
|
||||||
if: matrix.build_type == 'backend'
|
if: matrix.build_type == 'backend'
|
||||||
env:
|
env:
|
||||||
LOAD_PLUGINS: ${{ (matrix.target == 'plugins') && '1' || '0' }}
|
LOAD_PLUGINS: ${{ (matrix.target == 'plugins') && '1' || '0' }}
|
||||||
@ -172,6 +172,21 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
- name: Core RSpec
|
||||||
if: matrix.build_type == 'backend' && matrix.target == 'core'
|
if: matrix.build_type == 'backend' && matrix.target == 'core'
|
||||||
run: bin/turbo_rspec --use-runtime-info --verbose
|
run: bin/turbo_rspec --use-runtime-info --verbose
|
||||||
|
Loading…
x
Reference in New Issue
Block a user