diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23c8f34..6a0b0b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,12 +25,20 @@ jobs: - name: Install UI dependencies working-directory: ./ui - run: npm ci + run: | + npm ci + npm install --save-dev @vitest/coverage-v8 - - name: Run UI tests + - name: Run tests with coverage working-directory: ./ui - run: npm test + run: npm run test:coverage + - name: Archive code coverage results + uses: actions/upload-artifact@v3 + with: + name: code-coverage-report + path: ui/coverage/ + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/ui/package.json b/ui/package.json index 52f21dc..64c53c4 100644 --- a/ui/package.json +++ b/ui/package.json @@ -8,7 +8,8 @@ "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", - "test": "vitest" + "test": "vitest", + "test:coverage": "vitest run --coverage" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.5.1",