Skip to content

Commit

Permalink
feat: add new workflow - Pull Request
Browse files Browse the repository at this point in the history
  • Loading branch information
drondiodev committed Jul 23, 2024
1 parent bf0ef40 commit 97be7c1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/run-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Coverage on Pull Request
on: pull_request

jobs:
build-and-run-coverage:
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: pnpm i

- name: Build
run: pnpm run build

- name: Run test and coverage
run: pnpm run coverage

- name: Report Coverage
uses: davelosert/vitest-coverage-report-action@v2
5 changes: 5 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
coverage: {
provider: 'v8',
extension: ['.tsx'],
reporter: ['text', 'json-summary', 'json'],
},
},
})

0 comments on commit 97be7c1

Please sign in to comment.