Skip to content

Commit 68d878b

Browse files
committed
[#70175] Add Hocuspocus to CI
1 parent ddbacb3 commit 68d878b

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/workflows/test-core.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
with:
3737
metrics: cpu,memory,disk,io,network
3838
- uses: actions/checkout@v6
39+
- uses: actions/checkout@v6
40+
with:
41+
repository: opf/op-blocknote-hocuspocus
42+
ref: dev
43+
path: vendor/hocuspocus
3944
- name: Cache DOCKER
4045
id: cache_docker
4146
uses: runs-on/cache@v4

docker/ci/entrypoint.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ cleanup() {
2323
echo "CLEANUP"
2424
rm -rf tmp/cache/parallel*
2525

26+
# kill hocuspocus running in background:
27+
killall node || true
2628
if [ ! $exit_code -eq "0" ]; then
2729
echo "ERROR: exit code $exit_code"
2830
tail -n 1000 $LOG_FILE
@@ -95,6 +97,24 @@ reset_dbs() {
9597
done
9698
}
9799

100+
setup_hocuspocus() {
101+
if [ -d "vendor/hocuspocus" ]; then
102+
cd vendor/hocuspocus
103+
npm install --omit=dev
104+
cd -
105+
else
106+
echo 'Could not find Hocuspocus in vendor/hocuspocus!'
107+
fi
108+
}
109+
110+
start_hocuspocus() {
111+
if [ -d "vendor/hocuspocus" ]; then
112+
execute "cd vendor/hocuspocus && SECRET=secret12345 npm run start"
113+
else
114+
echo 'Could not find Hocuspocus in vendor/hocuspocus!'
115+
fi
116+
}
117+
98118
backend_stuff() {
99119
# create test database "app" and dump schema because db/structure.sql is not checked in
100120
execute_quiet "time bundle exec rails db:create db:migrate db:schema:dump zeitwerk:check"
@@ -122,6 +142,7 @@ setup_tests() {
122142
run_background execute "JOBS=8 time npm install --quiet && npm prune --quiet && echo NPM DONE"
123143
wait_for_background
124144

145+
setup_hocuspocus
125146
run_background backend_stuff
126147
run_background frontend_stuff
127148
# pre-cache browsers and their drivers binaries
@@ -138,6 +159,7 @@ run_units() {
138159
}
139160

140161
run_features() {
162+
run_background start_hocuspocus
141163
reset_dbs
142164
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features"
143165
cleanup
@@ -149,7 +171,7 @@ run_all() {
149171
cleanup
150172
}
151173

152-
export -f cleanup execute execute_quiet run_psql create_db_cluster reset_dbs setup_tests backend_stuff frontend_stuff run_units run_features run_all
174+
export -f cleanup execute execute_quiet run_psql create_db_cluster reset_dbs setup_tests setup_hocuspocus start_hocuspocus backend_stuff frontend_stuff run_units run_features run_all
153175

154176
if [ "$1" == "setup-tests" ]; then
155177
shift

0 commit comments

Comments
 (0)