From e178aff9cd0333a2589fdc29f16a9cba75d09d43 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 11:19:09 +0000 Subject: [PATCH 1/2] ci: add GitHub Actions QA workflow Set up automated quality assurance checks: - Lint: runs ESLint - Build: runs TypeScript + Vite build - Test: runs Vitest in CI mode All jobs run in parallel on push/PR to main/master. --- .github/workflows/qa.yml | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/qa.yml diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..5528efd --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,62 @@ +name: QA + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run ESLint + run: npm run lint + + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm run test:run From ec7615503769938e5e2a52237d8eea91402fde6d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 11:24:58 +0000 Subject: [PATCH 2/2] fix: add missing mocks in publish-spell test - Add pubkey to mocked accountManager.active - Mock relayListCache.getOutboxRelays to prevent undefined error --- src/actions/publish-spell.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/actions/publish-spell.test.ts b/src/actions/publish-spell.test.ts index 7e870ee..49a5e0c 100644 --- a/src/actions/publish-spell.test.ts +++ b/src/actions/publish-spell.test.ts @@ -10,6 +10,7 @@ vi.mock("@/services/accounts", () => ({ default: { active: { signer: {}, + pubkey: "test-pubkey", }, }, })); @@ -24,6 +25,12 @@ vi.mock("@/services/spell-storage", () => ({ markSpellPublished: vi.fn(), })); +vi.mock("@/services/relay-list-cache", () => ({ + relayListCache: { + getOutboxRelays: vi.fn().mockResolvedValue([]), + }, +})); + describe("PublishSpellAction", () => { let action: PublishSpellAction; @@ -62,6 +69,7 @@ describe("PublishSpellAction", () => { // @ts-expect-error: mocking internal state for test accountManager.active = { signer: mockSigner, + pubkey: "pubkey", }; const spell: LocalSpell = {