Skip to content

Commit

Permalink
✨ feat: CI Workflow for linting and integrity (#200)
Browse files Browse the repository at this point in the history
* ✨ feat: CI Workflow for linting and integrity

* chore: added lint-staged as a dev dep

---------

Co-authored-by: pawann-2000 <[email protected]>
  • Loading branch information
pawann-2000 and pawann-2000 authored Aug 16, 2024
1 parent 1b9796d commit d17c4bd
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Continuous Integration

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20.9.0'

- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run format check
run: npm run check

- name: Run build
run: npm run build
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format
npx lint-staged
4 changes: 0 additions & 4 deletions .husky/pre-push

This file was deleted.

4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"src/**/*.{js,jsx,ts,tsx,json}": ["eslint --fix"],
"src/**/*.{js,jsx,ts,tsx,json,css,md}": ["prettier --write"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"eslint": "^8",
"eslint-config-next": "14.2.5",
"husky": "^9.1.4",
"lint-staged": "^15.2.9",
"postcss": "^8",
"prettier": "^3.3.3",
"prisma": "^5.18.0",
Expand Down

0 comments on commit d17c4bd

Please sign in to comment.