Skip to content

Commit

Permalink
Add code coverage to CI suite
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbrethorst committed Jan 16, 2025
1 parent 5be907b commit c8adb45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
Expand Down

0 comments on commit c8adb45

Please sign in to comment.