Skip to content

Commit

Permalink
Merge pull request #223 from PysioHub/main
Browse files Browse the repository at this point in the history
更新版本 fix: #222
  • Loading branch information
pysio2007 authored Dec 13, 2024
2 parents 97a5b17 + 5b9a70e commit a1c4f0b
Show file tree
Hide file tree
Showing 12 changed files with 10,718 additions and 6,183 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Coveralls Tests
on: [push, pull_request]
env:
CI: true

jobs:
test:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [18, 20, 21]
os: [ubuntu-latest, windows-latest]

steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Set Node.js version
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install npm dependencies
run: npm install

- name: Run Build
run: npm run docs:build

- name: Run tests with coverage
run: npm run coverage

# - name: Upload coverage to Coveralls
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ./coverage/lcov.info
# flag-name: ${{ matrix.os }}-node-${{ matrix.node }}
# parallel: true

# finish:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Clone repository
# uses: actions/checkout@v3

# - name: Coveralls Finished
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
src/.vuepress/.cache/
src/.vuepress/.temp/
src/.vuepress/dist/
coverage
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![note build](https://github.com/pysio2007/Vue-blog/actions/workflows/bulid-server.yml/badge.svg)](https://github.com/pysio2007/Vue-blog/actions/workflows/bulid-server.yml)
[![Build Docker Image](https://github.com/pysio2007/Vue-blog/actions/workflows/bulid-docker.yml/badge.svg)](https://github.com/pysio2007/Vue-blog/actions/workflows/bulid-docker.yml)
[![可靠性评级](https://sonarqube.pysio.online/api/project_badges/measure?project=pysio2007_Vue-blog_4ce9d341-7a3c-4327-8552-71bbe67bb1ca&metric=reliability_rating&token=sqb_136ab7accc7d12a217881f398f214de786ad6b55)](https://sonarqube.pysio.online/dashboard?id=pysio2007_Vue-blog_4ce9d341-7a3c-4327-8552-71bbe67bb1ca)
<!-- [![Coverage Status](https://coveralls.io/repos/github/pysio2007/Vue-blog/badge.svg?branch=main)](https://coveralls.io/github/pysio2007/Vue-blog?branch=main) -->
[![wakatime](https://wakatime.com/badge/user/a8344004-6b9a-4a56-8b71-e626b395781c/project/d910a3a5-e3e2-425e-be0f-175d36fa6d19.svg)](https://wakatime.com/badge/user/a8344004-6b9a-4a56-8b71-e626b395781c/project/d910a3a5-e3e2-425e-be0f-175d36fa6d19)
## 关于本仓库

Expand Down
7 changes: 7 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
presets: [
'@babel/preset-env',
'@babel/preset-typescript',
],
sourceMaps: 'inline',
};
29 changes: 29 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @type {import('jest').Config} */
const config = {
collectCoverage: true,
coverageDirectory: "coverage",
coverageProvider: "v8",
testEnvironment: "node",
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', {
sourceMaps: false,
plugins: ['@babel/plugin-transform-modules-commonjs']
}]
},
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json", "node"],
testMatch: [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[tj]s?(x)"
],
collectCoverageFrom: [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts",
"!src/.vuepress/**/*",
"!**/node_modules/**"
],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1"
}
};

export default config;
Loading

0 comments on commit a1c4f0b

Please sign in to comment.