Skip to content

Commit

Permalink
chore: bump version, add vitest-coverage-reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyingchun committed Aug 8, 2024
1 parent 5c54840 commit 2a9b682
Show file tree
Hide file tree
Showing 5 changed files with 737 additions and 563 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/coverage-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: (main) coverage badge

on:
workflow_dispatch:
push:
branches:
- main

jobs:
coverage-badge:
strategy:
matrix:
os:
- ubuntu-latest
node:
- 18.14.2
pnpm:
- 7
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: 📥 Install Dependencies
run: yarn --frozen-lockfile

- name: run coverage
run: yarn test:coverage

- name: generate badges
run: yarn generate-badges

- name: push coverage artifacts to another branch
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./coverage
publish_branch: coverage
allow_empty_commit: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: (main) coverage badge
name: coverage markdown

on:
workflow_dispatch:
Expand Down Expand Up @@ -36,9 +36,9 @@ jobs:
run: yarn --frozen-lockfile

- name: 'Run test coverage'
run: npx vitest --coverage.enabled true
run: yarn test:coverage

- name: 'Report Coverage'
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
uses: davelosert/vitest-coverage-report-action@v2
uses: hyperse-io/vitest-coverage-reporter@v1
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
"build": "rimraf dist && tsc -p ./tsconfig.build.json",
"changeset": "changeset",
"cz": "cz",
"generate-badges": "generate-badges",
"lint": "eslint .",
"lint-fix": "yarn lint --fix",
"lint-staged-files": "lint-staged --allow-empty",
"prepare": "husky",
"release": "yarn build && changeset publish",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"generate-badges": "node ./scripts/generate-badges.mjs",
"typecheck": "tsc --project ./tsconfig.json --noEmit"
},
"config": {
Expand All @@ -59,9 +59,10 @@
"devDependencies": {
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.7",
"@commitlint/cli": "19.3.0",
"@commitlint/cli": "19.4.0",
"@commitlint/config-conventional": "19.2.2",
"@hyperse/eslint-config-hyperse": "^1.0.12",
"@hyperse/eslint-config-hyperse": "^1.1.0",
"@hyperse/vitest-coverage-reporter": "^1.0.2",
"@types/node": "^22.1.0",
"@vitest/coverage-istanbul": "^2.0.5",
"cheerio": "^1.0.0-rc.12",
Expand Down
6 changes: 3 additions & 3 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
"prism-react-renderer": "^2.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.7"
"tailwindcss": "^3.4.8"
},
"devDependencies": {
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.7",
"@commitlint/cli": "19.3.0",
"@commitlint/cli": "19.4.0",
"@commitlint/config-conventional": "19.2.2",
"@docusaurus/module-type-aliases": "3.4.0",
"@hyperse/eslint-config-hyperse": "^1.0.12",
"@hyperse/eslint-config-hyperse": "^1.1.0",
"@tsconfig/docusaurus": "^2.0.3",
"@types/node": "^22.1.0",
"@types/react": "^18.3.3",
Expand Down
Loading

0 comments on commit 2a9b682

Please sign in to comment.