Skip to content

A platform for community discussion. Free, open, simple.

DEV: Introduce Zeitwerk reloading check in CI (#22151)

David Taylor251d6f06273e
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index b6cbd383a15..b96dcd6b171 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -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