mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 15:13:30 +00:00
chore: add linting scripts for frontend, backend, and worker, and create a Gitea workflow for automated linting on push and pull request events
This commit is contained in:
66
.gitea/workflows/lint.yaml
Normal file
66
.gitea/workflows/lint.yaml
Normal file
@@ -0,0 +1,66 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'dev'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint-front:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Install front dependencies
|
||||
run: |
|
||||
corepack enable
|
||||
corepack use pnpm@latest
|
||||
pnpm i
|
||||
|
||||
- name: Run frontend lint
|
||||
run: pnpm lint:front
|
||||
|
||||
lint-backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Install golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Run backend lint
|
||||
run: cd backend && golangci-lint run
|
||||
|
||||
lint-worker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Install golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Run worker lint
|
||||
run: cd worker && golangci-lint run
|
||||
@@ -8,7 +8,10 @@
|
||||
"dev:front": "cd front && pnpm run dev",
|
||||
"dev:backend": "cd backend && air",
|
||||
"dev:worker": "cd worker && air",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint": "concurrently -n front,backend,worker -c blue,green,yellow 'pnpm:lint:front' 'pnpm:lint:backend' 'pnpm:lint:worker'",
|
||||
"lint:front": "cd front && pnpm nuxt typecheck",
|
||||
"lint:backend": "cd backend && golangci-lint run",
|
||||
"lint:worker": "cd worker && golangci-lint run",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"workspaces": [
|
||||
|
||||
Reference in New Issue
Block a user