Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Frontend

# Runs the renderer vitest suite. This suite was silently dead for months
# because no workflow executed it (vitest only auto-loads vite.config.ts /
# vitest.config.ts, and the repo had neither until #171) — this job is the
# guard against that happening again.
#
# Typecheck is intentionally NOT run here yet: forge.config.ts and
# update-electron-app carry pre-existing type errors. Add `npm run typecheck`
# once those are fixed.

on:
push:
branches: [main]
pull_request:
paths:
- "frontend/**"
- ".github/workflows/frontend.yml"
Comment on lines +12 to +18

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The push trigger on main has no paths filter, so this job runs on every push to main regardless of which files were changed (e.g., a backend-only or docs-only commit). The sibling go.yml workflow sets a paths filter for its push trigger to avoid this. Adding the same filter here would keep CI consistent and avoid burning runner minutes on unrelated pushes.

Suggested change
on:
push:
branches: [main]
pull_request:
paths:
- "frontend/**"
- ".github/workflows/frontend.yml"
on:
push:
branches: [main]
paths:
- "frontend/**"
- ".github/workflows/frontend.yml"
pull_request:
paths:
- "frontend/**"
- ".github/workflows/frontend.yml"


permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json

- run: npm ci

- name: Run vitest suite
run: npx vitest run
Comment on lines +40 to +41

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The test script in package.json already maps to vitest run ("test": "vitest run"), so npm test is the conventional interface here. Using npx vitest run bypasses the package.json script contract — if the test invocation ever gains flags or env-vars via package.json (e.g., coverage flags, reporters), CI would silently not pick them up.

Suggested change
- name: Run vitest suite
run: npx vitest run
- name: Run vitest suite
run: npm test

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Loading
Loading