ci: 新增 ci 流程配置
parent
d7474504e7
commit
0d9e93a117
|
@ -0,0 +1,39 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7
|
||||
|
||||
- name: Set node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: pnpm
|
||||
|
||||
- name: Install
|
||||
run: pnpm i
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
- name: Test
|
||||
run: pnpm test
|
|
@ -32,6 +32,7 @@
|
|||
"cz": "czg",
|
||||
"build": "esno scripts/build.ts",
|
||||
"release": "esno scripts/release.ts",
|
||||
"test": "vitest run",
|
||||
"lint": "eslint --cache .",
|
||||
"lint:fix": "pnpm lint --fix",
|
||||
"postinstall": "simple-git-hooks"
|
||||
|
@ -51,7 +52,6 @@
|
|||
"enquirer": "^2.3.6",
|
||||
"eslint": "^8.36.0",
|
||||
"esno": "^0.16.3",
|
||||
"jest": "^29.5.0",
|
||||
"lint-staged": "13.2.0",
|
||||
"minimist": "^1.2.8",
|
||||
"prettier": "2.8.5",
|
||||
|
@ -62,7 +62,8 @@
|
|||
"semver": "^7.3.8",
|
||||
"simple-git-hooks": "^2.8.1",
|
||||
"typescript": "^5.0.2",
|
||||
"vitepress": "1.0.0-alpha.60"
|
||||
"vitepress": "1.0.0-alpha.60",
|
||||
"vitest": "^0.29.7"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
"pre-commit": "pnpm lint-staged",
|
||||
|
|
1612
pnpm-lock.yaml
1612
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,11 @@
|
|||
import { resolve } from 'node:path';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import { __dirname } from './scripts/utils';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
root: resolve(__dirname),
|
||||
globals: true,
|
||||
include: ['./test/**/*.test.ts'],
|
||||
},
|
||||
});
|
Loading…
Reference in New Issue