chore: add check action

This commit is contained in:
hayden
2024-11-11 11:40:11 +08:00
parent 6904aca24c
commit f57ffc9e7a
4 changed files with 111 additions and 0 deletions

39
.github/workflows/eslint.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: ESLint
on:
push:
paths:
- '**/*.vue'
- '**/*.ts'
- '**/*.tsx'
- '**/*.js'
pull_request:
paths:
- '**/*.vue'
- '**/*.ts'
- '**/*.tsx'
- '**/*.js'
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Lint code
run: pnpm run lint

40
.github/workflows/format.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Prettier Check
on:
push:
paths:
- '**/*.vue'
- '**/*.ts'
- '**/*.tsx'
- '**/*.js'
pull_request:
paths:
- '**/*.vue'
- '**/*.ts'
- '**/*.tsx'
- '**/*.js'
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run Prettier check
run: pnpm exec prettier --check './**/*.{js,ts,tsx,vue}'

29
.github/workflows/pylint.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Python Linting
on:
push:
paths:
- '**/*.py'
pull_request:
paths:
- '**/*.py'
jobs:
pylint:
name: Run Pylint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Pylint
run: pip install pylint
- name: Run Pylint
run: pylint --rcfile=.pylintrc $(find . -type f -name "*.py")

3
.pylintrc Normal file
View File

@@ -0,0 +1,3 @@
[MESSAGES CONTROL]
disable=all
enable=eval-used