3838 - name : Run unit tests
3939 run : tox -e test-unit
4040
41+ ui-unit-tests :
42+ permissions :
43+ contents : " read"
44+ runs-on : ubuntu-latest
45+ steps :
46+ - name : Check out code
47+ uses : actions/checkout@v3
48+
49+ - name : Set up Node.js 22
50+ uses : actions/setup-node@v4
51+ with :
52+ node-version : ' 22'
53+
54+ - name : Install dependencies
55+ run : npm ci
56+
57+ - name : Run unit tests
58+ run : npm run test:unit
59+
4160 integration-tests :
4261 runs-on : ubuntu-latest
4362 strategy :
5473 - name : Run integration tests
5574 run : tox -e test-integration -- -m "smoke or sanity"
5675
76+ ui-integration-tests :
77+ permissions :
78+ contents : " read"
79+ runs-on : ubuntu-latest
80+ steps :
81+ - name : Check out code
82+ uses : actions/checkout@v3
83+
84+ - name : Set up Node.js 22
85+ uses : actions/setup-node@v4
86+ with :
87+ node-version : ' 22'
88+
89+ - name : Install dependencies
90+ run : npm ci
91+
92+ - name : Run integration tests
93+ run : npm run test:integration
94+
5795 e2e-tests :
5896 runs-on : ubuntu-latest
5997 strategy :
@@ -70,6 +108,35 @@ jobs:
70108 - name : Run integration tests
71109 run : tox -e test-e2e -- -m smoke
72110
111+ ui-e2e-tests :
112+ permissions :
113+ contents : " read"
114+ id-token : " write"
115+ runs-on : ubuntu-latest
116+ steps :
117+ - name : Check out code
118+ uses : actions/checkout@v3
119+
120+ - name : Set up Node.js 22
121+ uses : actions/setup-node@v4
122+ with :
123+ node-version : ' 22'
124+
125+ - name : Install dependencies
126+ run : npm ci
127+
128+ - name : Generate Build
129+ run : |
130+ npm run build
131+
132+ - name : Start the Next.js app
133+ run : |
134+ npx serve@latest src/ui/out &
135+ npx wait-on http://localhost:3000 # Wait until the app is ready
136+
137+ - name : Run Cypress tests
138+ run : npm run test:e2e --headless
139+
73140 build-and-publish :
74141 needs : [unit-tests, integration-tests, e2e-tests]
75142 runs-on : ubuntu-latest
@@ -123,3 +190,57 @@ jobs:
123190 - name : Log artifact location
124191 run : |
125192 echo "Artifacts uploaded to: ${{ steps.artifact-upload.outputs.artifact-url }}"
193+
194+ publish-ui-build :
195+ needs : [ui-unit-tests, ui-integration-tests, ui-e2e-tests]
196+ permissions :
197+ contents : write
198+ pull-requests : write
199+ issues : write
200+ runs-on : ubuntu-latest
201+ steps :
202+ - name : Check out code
203+ uses : actions/checkout@v3
204+
205+ - name : Set up Node.js 22
206+ uses : actions/setup-node@v4
207+ with :
208+ node-version : ' 22'
209+
210+ - name : Install dependencies
211+ run : npm ci
212+
213+ - name : " Set GIT_TAG"
214+ id : vars
215+ run : |
216+ if [ -z "${{ github.ref_name }}" ]; then
217+ echo "TAG=latest" >> $GITHUB_ENV
218+ else
219+ echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
220+ fi
221+
222+ - name : Build app to root
223+ id : build
224+ run : |
225+ # Export vars to ensure they are loaded before build
226+ export $(grep -v '^#' .env.staging | xargs)
227+
228+ # Set asset prefix and base path with git tag
229+ ASSET_PREFIX=https://neuralmagic.github.io/guidellm/ui/nightly
230+ BASE_PATH=/ui/nightly
231+ GIT_SHA=${{ github.sha }}
232+ export ASSET_PREFIX=${ASSET_PREFIX}
233+ export BASE_PATH=${BASE_PATH}
234+ export GIT_SHA=${GIT_SHA}
235+ npm run build
236+
237+ - name : Update latest build in GitHub Pages
238+ uses : peaceiris/actions-gh-pages@v3
239+ with :
240+ github_token : ${{ secrets.GITHUB_TOKEN }}
241+ publish_dir : ./ui/out
242+ destination_dir : ui/nightly
243+ keep_files : false
244+ user_name : ${{ github.actor }}
245+ user_email : ${{ github.actor }}@users.noreply.github.com
246+ publish_branch : gh-pages
0 commit comments