Skip to content

Commit

Permalink
ci: setup coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnyq committed Jun 25, 2023
1 parent 19b4640 commit 33af451
Show file tree
Hide file tree
Showing 9 changed files with 843 additions and 370 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test

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

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: pnpm run typecheck

test:
runs-on: ubuntu-latest
needs: [check]
strategy:
matrix:
node: [16.14, 18]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v2

- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run test

coverage:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run coverage
- uses: codecov/codecov-action@v3
27 changes: 0 additions & 27 deletions .github/workflows/test.yml

This file was deleted.

11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,14 @@
"javascriptreact",
"typescriptreact"
],
"cSpell.words": ["noopener", "pnpm", "starptech", "tsbuildinfo", "tsup", "vitest"]
"cSpell.words": [
"codecov",
"lcov",
"noopener",
"pnpm",
"starptech",
"tsbuildinfo",
"tsup",
"vitest"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

some gulp plugins

[![Test](https://github.com/ntnyq/gulp-plugins/actions/workflows/test.yml/badge.svg)](https://github.com/ntnyq/gulp-plugins/actions/workflows/test.yml)
[![CI](https://github.com/ntnyq/gulp-plugins/actions/workflows/ci.yml/badge.svg)](https://github.com/ntnyq/gulp-plugins/actions/workflows/ci.yml)
[![LICENSE](https://img.shields.io/github/license/ntnyq/gulp-plugins?logo=github)](https://github.com/ntnyq/gulp-plugins/blob/master/LICENSE)

## packages
Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "gulp-plugins",
"private": true,
"packageManager": "pnpm@8.5.0",
"packageManager": "pnpm@8.6.3",
"scripts": {
"build": "turbo run --filter=\"./packages/*\" --parallel build",
"clean": "rimraf packages/*/dist packages/*/*.tsbuildinfo",
"coverage": "vitest --coverage",
"dev": "pnpm run --filter=\"./packages/*\" --parallel dev",
"lint": "eslint .",
"prepare": "husky install",
Expand All @@ -15,22 +16,23 @@
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@ntnyq/eslint-config": "^1.7.3",
"@ntnyq/prettier-config": "^1.7.3",
"@ntnyq/eslint-config": "^1.9.0",
"@ntnyq/prettier-config": "^1.9.0",
"@types/vinyl": "^2.0.7",
"eslint": "^8.40.0",
"@vitest/coverage-v8": "^0.32.2",
"eslint": "^8.43.0",
"fast-glob": "^3.2.12",
"husky": "8.0.3",
"nano-staged": "^0.8.0",
"pnpm": "^8.5.0",
"pnpm": "^8.6.3",
"prettier": "^2.8.8",
"rimraf": "^5.0.0",
"tsup": "^6.7.0",
"rimraf": "^5.0.1",
"tsup": "^7.0.0",
"tsx": "^3.12.7",
"turbo": "^1.9.4",
"typescript": "^5.0.4",
"turbo": "^1.10.6",
"typescript": "^5.1.3",
"vinyl": "^3.0.0",
"vitest": "^0.31.0"
"vitest": "^0.32.2"
},
"prettier": "@ntnyq/prettier-config",
"nano-staged": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gulp-format-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@ntnyq/logger": "^0.0.2",
"@types/js-beautify": "^1.13.3",
"@types/through2": "^2.0.38",
"js-beautify": "^1.14.7",
"js-beautify": "^1.14.8",
"plugin-error": "^2.0.1",
"through2": "^4.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['./src/*.ts'],
format: ['cjs', 'esm'],
target: 'node14',
target: 'node16',
clean: true,
shims: true,
splitting: true,
Expand Down
Loading

0 comments on commit 33af451

Please sign in to comment.