Skip to content

Commit 26151e2

Browse files
committed
feat(coverage): add test coverage checks
Add test coverage to package.json scripts and github actions. Thresholds were set to current state.
1 parent bf0dd15 commit 26151e2

File tree

5 files changed

+1248
-1920
lines changed

5 files changed

+1248
-1920
lines changed

.github/workflows/create-prerelease-sdk.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ jobs:
3131
- name: Install dependencies
3232
run: pnpm install
3333

34-
- name: Run tests
35-
run: pnpm test
34+
- name: 'Run unit tests'
35+
run: npx vitest --coverage.enabled true
36+
37+
- name: 'Report Coverage'
38+
# Set if: always() to also generate the report if tests are failing
39+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
40+
if: always()
41+
uses: davelosert/vitest-coverage-report-action@v2
3642

3743
semantic-release:
3844
needs: build-and-test

.github/workflows/create-release-sdk.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ jobs:
3131
- name: Install dependencies
3232
run: pnpm install
3333

34-
- name: Run tests
35-
run: pnpm test
34+
- name: 'Run unit tests'
35+
run: npx vitest --coverage.enabled true
36+
37+
- name: 'Report Coverage'
38+
# Set if: always() to also generate the report if tests are failing
39+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
40+
if: always()
41+
uses: davelosert/vitest-coverage-report-action@v2
3642

3743
semantic-release:
3844
needs: build-and-test

.github/workflows/dryrun-release-ci-sdk.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ jobs:
2929
- name: Install dependencies
3030
run: pnpm install
3131

32-
- name: Run tests
33-
run: pnpm test
32+
- name: 'Run unit tests'
33+
run: npx vitest --coverage.enabled true
34+
35+
- name: 'Report Coverage'
36+
# Set if: always() to also generate the report if tests are failing
37+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
38+
if: always()
39+
uses: davelosert/vitest-coverage-report-action@v2
3440

3541
semantic-release:
3642
needs: build-and-test

0 commit comments

Comments
 (0)