Skip to content

Commit

Permalink
chore: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo-shen committed Dec 28, 2023
1 parent ec8e136 commit 1f75086
Show file tree
Hide file tree
Showing 6 changed files with 969 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"root": true,
"extends": ["@vant"],
"ignorePatterns": ["dist", "node_modules"]
}
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'ci'
on:
push:
branches:
- '**'
pull_request:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
lint-and-test-dts:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'

- run: pnpm install

- name: Run eslint
run: pnpm run lint

- name: Run prettier
run: pnpm run format-check

# - name: Run type declaration tests
# run: pnpm run test-dts
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
4 changes: 4 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
singleQuote: true,
proseWrap: 'never',
};
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"typecheck": "vue-tsc --noEmit"
"check": "vue-tsc --noEmit",
"lint": "eslint --cache --max-warnings 0 .",
"format-check": "prettier --check --cache \"**/*.[tj]s?(x)\""
},
"dependencies": {
"@unocss/reset": "^0.58.0",
Expand All @@ -20,8 +22,11 @@
"devDependencies": {
"@types/node": "^20.10.5",
"@types/semver": "^7.5.6",
"@vant/eslint-config": "^4.0.0",
"@vitejs/plugin-vue": "^4.5.2",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.56.0",
"prettier": "^3.1.1",
"sass": "^1.69.5",
"typescript": "^5.3.3",
"vite": "^5.0.8",
Expand Down
Loading

0 comments on commit 1f75086

Please sign in to comment.