From c8adb4575e67a8ccc5c21093276701f0bd9c30b7 Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Thu, 16 Jan 2025 15:14:54 -0800 Subject: [PATCH] Add code coverage to CI suite --- .github/workflows/test.yml | 10 ++++++++-- vite.config.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e40174..4bb8396 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,16 +27,22 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Install dependencies run: npm install - name: Run tests - run: npm run test + run: npx vitest run --coverage env: CI: true + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + files: ./coverage/lcov.info + - name: Display test results if: failure() run: | diff --git a/vite.config.js b/vite.config.js index 0d082ad..340cf26 100644 --- a/vite.config.js +++ b/vite.config.js @@ -8,7 +8,7 @@ export default defineConfig({ coverage: { provider: 'v8', reportsDirectory: './coverage', - reporter: ['html'], + reporter: ['html', 'lcov'], all: true, exclude: ['**/tests', '.svelte-kit', 'build', 'coverage', 'node_modules'] }