Skip to content

Commit

Permalink
ci: use github actions to check the code for linting and formatting e…
Browse files Browse the repository at this point in the history
…rrors (#373)

* ci: add github actions

* chore: add a `.nvmrc`

* build: better naming

* style: formatting

* ci: try caching the installed deps

* ci: just make it much simpler
  • Loading branch information
SeanCassiere authored Jun 22, 2024
1 parent fa56f84 commit 9ceefa2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: pr

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
lint-and-format:
name: lint-and-format
runs-on: ubuntu-latest
steps:
# This step uses the actions/checkout action to download a copy of your repository on the runner.
- name: Checkout repo
uses: actions/checkout@v4

# This step uses the pnpm/action-setup action to set up pnpm on the runner.
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9

# This step uses the actions/setup-node action to set up a Node.js environment on the runner.
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

# This step runs the install script for the selected node package manager.
- name: Install dependencies
run: pnpm install --frozen-lockfile

# This step runs the ci script for linting to check for linting errors.
- name: Run the linter to check for linting errors
run: pnpm ci:lint

# This step runs the ci script for formatting to check for formatting errors.
- name: Run the formatter to check for formatting errors
run: pnpm ci:format
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.10.0
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
"dev": "vite",
"lint": "eslint --max-warnings 0 .",
"lint:fix": "eslint --fix --max-warnings 0 .",
"format": "prettier --write './src/**/*.{js,jsx,ts,tsx,css,md,json}' --config ./prettier.config.cjs",
"format": "prettier --check './src/**/*.{js,jsx,ts,tsx,css,md,json}' --config './prettier.config.cjs'",
"format:fix": "prettier --write './src/**/*.{js,jsx,ts,tsx,css,md,json}' --config './prettier.config.cjs'",
"clean": "rimraf ./dist && rimraf ./coverage",
"build:code": "tsc && vite build",
"build": "pnpm run clean && pnpm run lint && pnpm run build:code",
"postbuild": "node ./postbuild.cjs",
"preview": "vite preview --port 3000"
"preview": "vite preview --port 3000",
"ci:lint": "pnpm run lint",
"ci:format": "pnpm run format"
},
"dependencies": {
"@dnd-kit/core": "^6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const CardFooter = React.forwardRef<
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(" flex items-center p-6 pt-0", className)}
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
));
Expand Down

0 comments on commit 9ceefa2

Please sign in to comment.