Skip to content

Commit 76e1b4b

Browse files
authored
Merge branch 'implement-ui-build-pipeline' into save-as-html
2 parents c7adecb + 64c7b6b commit 76e1b4b

File tree

6 files changed

+179
-8
lines changed

6 files changed

+179
-8
lines changed

.github/workflows/nightly.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ jobs:
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:
@@ -54,6 +73,25 @@ jobs:
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

.github/workflows/release-candidate.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
- name: Check out code
4747
uses: actions/checkout@v3
4848

49+
- name: Set up Node.js 22
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: '22'
53+
4954
- name: Install dependencies
5055
run: npm ci
5156

@@ -76,6 +81,11 @@ jobs:
7681
- name: Check out code
7782
uses: actions/checkout@v3
7883

84+
- name: Set up Node.js 22
85+
uses: actions/setup-node@v4
86+
with:
87+
node-version: '22'
88+
7989
- name: Install dependencies
8090
run: npm ci
8191

@@ -107,6 +117,11 @@ jobs:
107117
- name: Check out code
108118
uses: actions/checkout@v3
109119

120+
- name: Set up Node.js 22
121+
uses: actions/setup-node@v4
122+
with:
123+
node-version: '22'
124+
110125
- name: Install dependencies
111126
run: npm ci
112127

@@ -177,6 +192,11 @@ jobs:
177192
- name: Check out code
178193
uses: actions/checkout@v3
179194

195+
- name: Set up Node.js 22
196+
uses: actions/setup-node@v4
197+
with:
198+
node-version: '22'
199+
180200
- name: Install dependencies
181201
run: npm ci
182202

@@ -226,6 +246,11 @@ jobs:
226246
- name: Check out code
227247
uses: actions/checkout@v3
228248

249+
- name: Set up Node.js 22
250+
uses: actions/setup-node@v4
251+
with:
252+
node-version: '22'
253+
229254
- name: Install dependencies
230255
run: npm ci
231256

@@ -242,7 +267,7 @@ jobs:
242267
id: build
243268
run: |
244269
# Export vars to ensure they are loaded before build
245-
export $(grep -v '^#' .env.development | xargs)
270+
export $(grep -v '^#' .env.staging | xargs)
246271
247272
# Set asset prefix and base path with git tag
248273
ASSET_PREFIX=https://neuralmagic.github.io/guidellm/release/latest

.github/workflows/release.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ jobs:
9191
- name: Check out code
9292
uses: actions/checkout@v3
9393

94+
- name: Set up Node.js 22
95+
uses: actions/setup-node@v4
96+
with:
97+
node-version: '22'
98+
9499
- name: Install dependencies
95100
run: npm ci
96101

@@ -121,6 +126,11 @@ jobs:
121126
- name: Check out code
122127
uses: actions/checkout@v3
123128

129+
- name: Set up Node.js 22
130+
uses: actions/setup-node@v4
131+
with:
132+
node-version: '22'
133+
124134
- name: Install dependencies
125135
run: npm ci
126136

@@ -152,6 +162,11 @@ jobs:
152162
- name: Check out code
153163
uses: actions/checkout@v3
154164

165+
- name: Set up Node.js 22
166+
uses: actions/setup-node@v4
167+
with:
168+
node-version: '22'
169+
155170
- name: Install dependencies
156171
run: npm ci
157172

@@ -176,6 +191,11 @@ jobs:
176191
- name: Check out code
177192
uses: actions/checkout@v3
178193

194+
- name: Set up Node.js 22
195+
uses: actions/setup-node@v4
196+
with:
197+
node-version: '22'
198+
179199
- name: Install dependencies
180200
run: npm ci
181201

@@ -192,7 +212,7 @@ jobs:
192212
id: build
193213
run: |
194214
# Export vars to ensure they are loaded before build
195-
export $(grep -v '^#' .env.development | xargs)
215+
export $(grep -v '^#' .env.production | xargs)
196216
197217
# Set asset prefix and base path with git tag
198218
ASSET_PREFIX=https://neuralmagic.github.io/guidellm/ui/${TAG}
@@ -225,6 +245,11 @@ jobs:
225245
- name: Check out code
226246
uses: actions/checkout@v3
227247

248+
- name: Set up Node.js 22
249+
uses: actions/setup-node@v4
250+
with:
251+
node-version: '22'
252+
228253
- name: Install dependencies
229254
run: npm ci
230255

src/ui/.env.development

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ASSET_PREFIX=https://review.neuralmagic.com/guidellm-ui/dev/_next
2-
BASE_PATH=/guidellm-ui/dev
1+
ASSET_PREFIX=https://neuralmagic.github.io/ui/dev
2+
BASE_PATH=/ui/dev
33
NEXT_PUBLIC_USE_MOCK_API=true

src/ui/.env.production

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ASSET_PREFIX=https://review.neuralmagic.com/guidellm-ui/dev/_next
2-
BASE_PATH=/guidellm-ui/dev
1+
ASSET_PREFIX=https://neuralmagic.github.io/ui/latest
2+
BASE_PATH=/ui/latest
33
NEXT_PUBLIC_USE_MOCK_API=true

src/ui/.env.staging

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ASSET_PREFIX=https://staging.guidellm.neuralmagic.com
2-
BASE_PATH=/guidellm-ui/staging
1+
ASSET_PREFIX=https://neuralmagic.github.io/ui/release/latest
2+
BASE_PATH=/ui/release/latest
33
NEXT_PUBLIC_USE_MOCK_API=true

0 commit comments

Comments
 (0)