From 7b20fc011b558a9fd792f95d1a530431d7290503 Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Sun, 1 Feb 2026 15:11:49 -0800 Subject: [PATCH] Add path filters to CI workflows and create UI test workflow (#501) * .github/workflows: add UI tests and path-filter Go CI Add ui-tests.yml workflow to run svelte type checking and vitest on push/PR to main when ui-svelte/ files change. - Add path filters to go-ci.yml and go-ci-windows.yml to skip Go tests when only non-backend files change - Filter on **/*.go, go.mod, go.sum, and Makefile https://claude.ai/code/session_01E6acq54D8JjuE7pczxPGT7 * ui-svelte: remove unused declarations in SpeechInterface Remove unused `generatedText` state and `clearAudio` function that caused svelte-check errors. https://claude.ai/code/session_01E6acq54D8JjuE7pczxPGT7 * .github/workflows: update Node.js to v24 Node 23 is end-of-life; bump to 24 in ui-tests.yml and release.yml. https://claude.ai/code/session_01E6acq54D8JjuE7pczxPGT7 --------- Co-authored-by: Claude --- .github/workflows/go-ci-windows.yml | 16 +++++++ .github/workflows/go-ci.yml | 16 +++++++ .github/workflows/release.yml | 2 +- .github/workflows/ui-tests.yml | 42 +++++++++++++++++++ .../playground/SpeechInterface.svelte | 14 ------- 5 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ui-tests.yml diff --git a/.github/workflows/go-ci-windows.yml b/.github/workflows/go-ci-windows.yml index cfcf71d8..df1abae8 100644 --- a/.github/workflows/go-ci-windows.yml +++ b/.github/workflows/go-ci-windows.yml @@ -3,9 +3,25 @@ name: Windows CI on: push: branches: [ "main" ] + # only run when backend source changes + # cmd/ is excluded because it contains utilities without tests + paths: + - '**/*.go' + - '!cmd/**' + - 'go.mod' + - 'go.sum' + - 'Makefile' + - '.github/workflows/go-ci-windows.yml' pull_request: branches: [ "main" ] + paths: + - '**/*.go' + - '!cmd/**' + - 'go.mod' + - 'go.sum' + - 'Makefile' + - '.github/workflows/go-ci-windows.yml' # Allows manual triggering of the workflow workflow_dispatch: diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index 4dc1b90c..aa51b1bf 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -3,9 +3,25 @@ name: Linux CI on: push: branches: [ "main" ] + # only run when backend source changes + # cmd/ is excluded because it contains utilities without tests + paths: + - '**/*.go' + - '!cmd/**' + - 'go.mod' + - 'go.sum' + - 'Makefile' + - '.github/workflows/go-ci.yml' pull_request: branches: [ "main" ] + paths: + - '**/*.go' + - '!cmd/**' + - 'go.mod' + - 'go.sum' + - 'Makefile' + - '.github/workflows/go-ci.yml' # Allows manual triggering of the workflow workflow_dispatch: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14a3534f..1c4c119c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "23" + node-version: "24" - name: Install dependencies and build UI run: | cd ui-svelte diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml new file mode 100644 index 00000000..235f7b4a --- /dev/null +++ b/.github/workflows/ui-tests.yml @@ -0,0 +1,42 @@ +name: UI Tests + +on: + push: + branches: [ "main" ] + paths: + - 'ui-svelte/**' + - '.github/workflows/ui-tests.yml' + + pull_request: + branches: [ "main" ] + paths: + - 'ui-svelte/**' + - '.github/workflows/ui-tests.yml' + + workflow_dispatch: + +jobs: + + run-tests: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ui-svelte + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + cache: 'npm' + cache-dependency-path: ui-svelte/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Type check + run: npm run check + + - name: Run tests + run: npm test diff --git a/ui-svelte/src/components/playground/SpeechInterface.svelte b/ui-svelte/src/components/playground/SpeechInterface.svelte index 2b9f4ae7..e9ab20a8 100644 --- a/ui-svelte/src/components/playground/SpeechInterface.svelte +++ b/ui-svelte/src/components/playground/SpeechInterface.svelte @@ -12,7 +12,6 @@ let inputText = $state(""); let isGenerating = $state(false); let generatedAudioUrl = $state(null); - let generatedText = $state(null); let generatedVoice = $state(null); let generatedTimestamp = $state(null); let error = $state(null); @@ -148,7 +147,6 @@ // Create object URL for the audio blob and store metadata generatedAudioUrl = URL.createObjectURL(audioBlob); - generatedText = trimmedText; generatedVoice = $selectedVoiceStore; generatedTimestamp = new Date(); } catch (err) { @@ -167,18 +165,6 @@ abortController?.abort(); } - function clearAudio() { - if (generatedAudioUrl) { - URL.revokeObjectURL(generatedAudioUrl); - } - generatedAudioUrl = null; - generatedText = null; - generatedVoice = null; - generatedTimestamp = null; - error = null; - inputText = ""; - } - function clearInput() { inputText = ""; }