Skip to content

Commit

Permalink
ci: add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Jan 6, 2023
1 parent 2061afd commit fd33310
Show file tree
Hide file tree
Showing 5 changed files with 1,477 additions and 859 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Coverage

env:
NODE_OPTIONS: --max-old-space-size=6144

on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
types:
- 'opened'
- 'synchronize'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
coverage:
permissions:
checks: write
pull-requests: write
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: pnpm run intall
run: |
pnpm install
- name: Run tests
run: pnpm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
patch: off
project:
default:
threshold: 5%

github_checks:
annotations: false
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"clean:turbo": "rimraf .turbo"
},
"devDependencies": {
"@ant-design/icons": "^4.8.0",
"@ant-design/pro-card": "^2.1.6",
"@ant-design/icons": "4.8.0",
"@ant-design/pro-card": "^2.1.8",
"@babel/plugin-transform-modules-commonjs": "7.20.11",
"@pansy/hook-utils": "workspace:*",
"@pansy/use-portal": "workspace:*",
Expand Down Expand Up @@ -76,37 +76,37 @@
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "13.4.0",
"@types/node": "^18.11.18",
"@types/jest": "^29.2.4",
"@types/jest": "^29.2.5",
"@types/testing-library__jest-dom": "5.14.5",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "5.47.1",
"@typescript-eslint/parser": "5.47.1",
"@umijs/test": "^4.0.40",
"@umijs/utils": "^4.0.40",
"@typescript-eslint/eslint-plugin": "5.48.0",
"@typescript-eslint/parser": "5.48.0",
"@umijs/test": "^4.0.42",
"@umijs/utils": "^4.0.42",
"@walrus/cli": "1.3.4",
"@walrus/cli-utils": "2.2.1",
"@walrus/package": "^1.1.0",
"@walrus/plugin-release": "1.14.3",
"antd": "5.1.1",
"antd": "5.1.2",
"cross-env": "7.0.3",
"conventional-changelog-cli": "2.2.2",
"conventional-changelog-gitmoji-config": "1.4.4",
"dumi": "2.0.17",
"eslint": "8.30.0",
"eslint-config-alloy": "4.7.0",
"eslint-config-prettier": "8.5.0",
"dumi": "2.0.18",
"eslint": "8.31.0",
"eslint-config-alloy": "4.8.0",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-react": "7.31.11",
"eslint-plugin-react-hooks": "4.6.0",
"hooks-scripts": "workspace:*",
"husky": "8.0.2",
"husky": "8.0.3",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
"jest-fetch-mock": "3.0.3",
"jest-localstorage-mock": "2.4.25",
"jest-localstorage-mock": "2.4.26",
"jest-websocket-mock": "2.4.0",
"lerna": "6.3.0",
"lerna": "6.4.0",
"mock-socket": "9.1.5",
"mockjs": "^1.1.0",
"react": "18.2.0",
Expand Down
Loading

0 comments on commit fd33310

Please sign in to comment.