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 24dac5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,26 @@ 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 reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/
flags: unittest
name: codecov-umbrella
fail_ci_if_error: true
verbose: true

- 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', 'json'],
all: true,
exclude: ['**/tests', '.svelte-kit', 'build', 'coverage', 'node_modules']
}
Expand Down

0 comments on commit 24dac5d

Please sign in to comment.