feat: add GitHub Actions workflow for frontend formatting and linting
All checks were successful
Backend CI / lint-and-test (push) Successful in 1m56s
All checks were successful
Backend CI / lint-and-test (push) Successful in 1m56s
This commit is contained in:
40
.github/workflows/frontend-format.yml
vendored
Normal file
40
.github/workflows/frontend-format.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Frontend Format
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "frontend/**"
|
||||||
|
- "scripts/**"
|
||||||
|
- ".github/workflows/frontend-format.yml"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
working-directory: frontend
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run Prettier
|
||||||
|
working-directory: frontend
|
||||||
|
run: npm run format -- --check
|
||||||
|
|
||||||
|
- name: Run ESLint (fix mode)
|
||||||
|
working-directory: frontend
|
||||||
|
run: npm run lint -- --fix
|
||||||
|
|
||||||
|
- name: Upload formatting diff
|
||||||
|
if: failure()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: frontend-formatting-diff
|
||||||
|
path: frontend
|
||||||
Reference in New Issue
Block a user