Skip to content

Commit

Permalink
codecov配置 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
222chaos authored Oct 25, 2024
1 parent fb2ac3a commit 56594bb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run Vitest and upload coverage to Codecov

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install

- name: Run tests
run: npx vitest run --coverage

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
7 changes: 7 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import { defineConfig } from 'vitest/config';

export default defineConfig({
esbuild: {
jsxInject: "import React from 'react'",
Expand All @@ -13,5 +14,11 @@ export default defineConfig({
alias: {
'@ant-design/md-editor': path.resolve(__dirname, './src'),
},
coverage: {
provider: 'istanbul',
reporter: ['text', 'text-summary', 'json', 'lcov'],
include: ['tests/demo/**', 'test/editor/**'],
exclude: [],
},
},
});

1 comment on commit 56594bb

@vercel
Copy link

@vercel vercel bot commented on 56594bb Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.