Skip to content

Commit

Permalink
Add CI with linters and formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-neti committed Jun 12, 2024
1 parent 9f93b61 commit 613371a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test linter and code formatter

on:
pull_request:
push:
branches:
- main

jobs:
lint:
strategy:
fail-fast: true

name: Run ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '16.14.2'

- name: Install Dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

formatting:
name: Run Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '16.14.2'

- name: Install Dependencies
run: npm ci

- name: Run Prettier
run: npm run prettier
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"format": "npx prettier --write ."
"format": "npx prettier --write .",
"prettier": "npx prettier --check ."
},
"dependencies": {
"@emotion/react": "^11.11.4",
Expand Down

0 comments on commit 613371a

Please sign in to comment.