Skip to content

Commit 91bb5e2

Browse files
committed
Add a basic SSR test to GitHub CI
1 parent 7fcd055 commit 91bb5e2

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,28 @@ jobs:
117117
chromedriver --url-base='/wd/hub' --port=4444 &
118118
yarn run e2e:ci
119119
120+
# Start up the app with SSR enabled (run in background)
121+
- name: Start app in SSR (server-side rendering) mode
122+
run: |
123+
nohup yarn run serve:ssr &
124+
printf 'Waiting for app to start'
125+
until curl --output /dev/null --silent --head --fail http://localhost:4000/home; do
126+
printf '.'
127+
sleep 2
128+
done
129+
echo "App started successfully."
130+
131+
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
132+
# If it does, then SSR is working, as this tag is created by our MetadataService.
133+
# This step also prints entire HTML of homepage for easier debugging if grep fails.
134+
- name: Verify SSR (server-side rendering)
135+
run: |
136+
result=$(wget -O- -q http://localhost:4000/home)
137+
echo "$result"
138+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
139+
140+
- name: Stop running app
141+
run: kill -9 $(lsof -t -i:4000)
142+
120143
- name: Shutdown Docker containers
121144
run: docker-compose -f ./docker/docker-compose-ci.yml down

0 commit comments

Comments
 (0)