Skip to content

Commit c87a3c6

Browse files
committed
ci: run web UI lint and coverage via make targets
- add test-coverage, test-coverage-backend, and test-coverage-frontend targets to the Makefile, reusing each workspace's test:coverage script - route the CI coverage steps through make test-coverage-* and fix exit-code masking with set -o pipefail + tee, so a failing suite now fails the job while the step-summary section stays well-formed - add a dedicated web-ui-lint job that runs make lint on every push and PR Signed-off-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
1 parent 385d696 commit c87a3c6

2 files changed

Lines changed: 58 additions & 14 deletions

File tree

.github/workflows/test.yml

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,54 @@ jobs:
2929
run: make compile
3030

3131
- name: Run backend tests with coverage
32+
shell: bash
3233
run: |
33-
cd backend
34-
echo "## 🧪 Backend Test Coverage" >> $GITHUB_STEP_SUMMARY
35-
echo "" >> $GITHUB_STEP_SUMMARY
36-
echo '```' >> $GITHUB_STEP_SUMMARY
37-
bun test --coverage 2>&1 | tail -20 >> $GITHUB_STEP_SUMMARY
38-
echo '```' >> $GITHUB_STEP_SUMMARY
39-
echo "" >> $GITHUB_STEP_SUMMARY
34+
set -o pipefail
35+
rc=0
36+
make test-coverage-backend 2>&1 | tee /tmp/backend-cov.log || rc=$?
37+
{
38+
echo "## 🧪 Backend Test Coverage"
39+
echo ""
40+
echo '```'
41+
tail -20 /tmp/backend-cov.log
42+
echo '```'
43+
echo ""
44+
} >> "$GITHUB_STEP_SUMMARY"
45+
exit $rc
4046
4147
- name: Run frontend tests with coverage
48+
shell: bash
4249
run: |
43-
cd frontend
44-
echo "## 🎨 Frontend Test Coverage" >> $GITHUB_STEP_SUMMARY
45-
echo "" >> $GITHUB_STEP_SUMMARY
46-
echo '```' >> $GITHUB_STEP_SUMMARY
47-
bun run test:coverage 2>&1 | tail -30 >> $GITHUB_STEP_SUMMARY
48-
echo '```' >> $GITHUB_STEP_SUMMARY
50+
set -o pipefail
51+
rc=0
52+
make test-coverage-frontend 2>&1 | tee /tmp/frontend-cov.log || rc=$?
53+
{
54+
echo "## 🎨 Frontend Test Coverage"
55+
echo ""
56+
echo '```'
57+
tail -30 /tmp/frontend-cov.log
58+
echo '```'
59+
echo ""
60+
} >> "$GITHUB_STEP_SUMMARY"
61+
exit $rc
62+
63+
web-ui-lint:
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
69+
70+
- name: Setup Bun
71+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
72+
with:
73+
bun-version: latest
74+
75+
- name: Install dependencies
76+
run: bun ci
77+
78+
- name: Lint (frontend + backend)
79+
run: make lint
4980

5081
controller-manifest-check:
5182
runs-on: ubuntu-latest

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: install dev dev-frontend dev-backend build compile lint test clean help providers-test verify-versions test-verify-versions
1+
.PHONY: install dev dev-frontend dev-backend build compile lint test test-coverage test-coverage-backend test-coverage-frontend clean help providers-test verify-versions test-verify-versions
22
.PHONY: controller-build controller-docker-build controller-install controller-deploy controller-generate generate-deploy-manifests
33
.PHONY: model-downloader-docker-build setup-gateway cleanup-gateway
44

@@ -41,6 +41,7 @@ help:
4141
@echo " compile-windows Cross-compile for Windows (x64)"
4242
@echo " lint Run linters"
4343
@echo " test Run tests"
44+
@echo " test-coverage Run tests with coverage (frontend + backend)"
4445
@echo " clean Remove build artifacts and node_modules"
4546
@echo ""
4647
@echo "Controller Targets:"
@@ -125,6 +126,18 @@ lint:
125126
test: verify-versions
126127
bun run test
127128

129+
# Testing with coverage (CI entrypoint). Coverage prints to stdout;
130+
# GitHub step-summary formatting lives in the workflow, not here.
131+
# Uses `cd <ws> && bun run test:coverage` (not `bun run --filter`) so output
132+
# stays unprefixed and the coverage tables render cleanly in the CI summary.
133+
test-coverage: verify-versions test-coverage-backend test-coverage-frontend
134+
135+
test-coverage-backend:
136+
cd backend && bun run test:coverage
137+
138+
test-coverage-frontend:
139+
cd frontend && bun run test:coverage
140+
128141
# Clean build artifacts
129142
clean:
130143
rm -rf node_modules frontend/node_modules backend/node_modules shared/node_modules

0 commit comments

Comments
 (0)