feat: 增加lint检测和覆盖率报告
This commit is contained in:
parent
6319ca272e
commit
91838194bb
39
.github/workflows/codecov.yml
vendored
Normal file
39
.github/workflows/codecov.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# Unit Test Coverage Report
|
||||
name: Test Coverage
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- feature/workflow
|
||||
- develop
|
||||
- main
|
||||
- releases/**
|
||||
- feature/**
|
||||
paths:
|
||||
- server/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Coverage
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd server && npm install
|
||||
|
||||
- name: Run tests and collect coverage
|
||||
run: cd server && npm run test:cov
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
34
.github/workflows/server-lint.yml
vendored
Normal file
34
.github/workflows/server-lint.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
# Lint
|
||||
name: Server Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- feature/workflow
|
||||
- develop
|
||||
- main
|
||||
- releases/**
|
||||
- feature/**
|
||||
paths:
|
||||
- server/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd server && npm install
|
||||
|
||||
- name: Lint
|
||||
run: cd server && npm run lint
|
34
.github/workflows/web-lint.yml
vendored
Normal file
34
.github/workflows/web-lint.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
# Lint
|
||||
name: Web Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- feature/workflow
|
||||
- develop
|
||||
- main
|
||||
- releases/**
|
||||
- feature/**
|
||||
paths:
|
||||
- web/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd web && npm install
|
||||
|
||||
- name: Lint
|
||||
run: cd web && npm run lint
|
Loading…
Reference in New Issue
Block a user