Skip to content

Commit

Permalink
ci(lint): add github action workflow for linting (#13)
Browse files Browse the repository at this point in the history
Resolves: #12
  • Loading branch information
IdoBouskila authored Nov 29, 2024
1 parent e936a2a commit 7260cae
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/client-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Client Lint

on:
pull_request:

jobs:
lint:
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: '18'

- name: Install dependencies (client)
working-directory: ./client
run: yarn install

- name: Run linter (client)
working-directory: ./client
run: yarn lint
25 changes: 25 additions & 0 deletions .github/workflows/server-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Server Lint

on:
pull_request:

jobs:
lint:
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: '18'

- name: Install dependencies (server)
working-directory: ./server
run: yarn install

- name: Run linter (server)
working-directory: ./server
run: yarn lint
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "weather-app",
"version": "1.0.0",
"description": "A simple weather app",
"scripts": {
"client": "cd client && yarn run dev",
"server": "cd server && node --watch server.js",
"lint::client": "cd client && yarn run lint",
"lint::server": "cd server && yarn run lint",
"lint": "yarn run lint::client && yarn run lint::server"
},
"author": "",
"license": "ISC"
}

0 comments on commit 7260cae

Please sign in to comment.