Skip to content

Commit

Permalink
feat: ci add test report (#95)
Browse files Browse the repository at this point in the history
* feat: ci add test report

* feat: ci add test report

* feat: add codecov check

* feat: update
  • Loading branch information
Talljack authored Mar 9, 2024
1 parent 7a67bba commit 4ae92cc
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -53,5 +58,10 @@ jobs:
- name: Build
run: nr build

- name: Test
run: nr test
- name: test coverage
run: nr coverage
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Talljack/unplugin-remove
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Auto remove `console[log|warn|error|info|debug]` and `debugger` in production mode.

<div>
<img src="https://img.shields.io/npm/dm/unplugin-remove" />
<img src="https://img.shields.io/github/last-commit/Talljack/unplugin-remove
">
</div>


## Install

```bash
Expand Down
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
comment: # this is a top-level key
layout: " diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: false # [true :: must have a base report to post]
require_head: true # [true :: must have a head report to post]
hide_project_coverage: false # [true :: only show coverage on the git diff]
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"prepublishOnly": "npm run build",
"release": "bumpp && npm publish",
"start": "esno src/index.ts",
"test": "vitest"
"test": "vitest",
"coverage": "vitest run --coverage"
},
"dependencies": {
"@rollup/pluginutils": "^5.1.0",
Expand All @@ -92,6 +93,7 @@
"@babel/traverse": "^7.24.0",
"@babel/types": "^7.24.0",
"@types/node": "^20.11.25",
"@vitest/coverage-v8": "^1.3.1",
"bumpp": "^9.4.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
8 changes: 8 additions & 0 deletions playground/vite/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
import unpluginRemoveVite from '../../src/vite'
Expand All @@ -7,4 +8,11 @@ export default defineConfig({
build: {
sourcemap: true,
},
test: {
coverage: {
all: true,
provider: 'istanbul',
reporter: ['text', 'json', 'html'],
}
}
})
109 changes: 109 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ae92cc

Please sign in to comment.