Skip to content

Commit 3e76a24

Browse files
authored
Create main.yml
1 parent 7b3a5ab commit 3e76a24

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/main.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 'Lint Code'
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
lint_python:
11+
name: Lint Python Files
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- name: Checkout Repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3.12
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install flake8
28+
29+
- name: Print working directory
30+
run: pwd
31+
32+
- name: Run Linter
33+
run: |
34+
pwd
35+
# This command finds all Python files recursively and runs flake8 on them
36+
find . -name "*.py" -exec flake8 {} +
37+
echo "Linted all the python files successfully"
38+
39+
lint_js:
40+
name: Lint JavaScript Files
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout Repository
45+
uses: actions/checkout@v3
46+
47+
- name: Install Node.js
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 14
51+
52+
- name: Install JSHint
53+
run: npm install jshint --global
54+
55+
- name: Run Linter
56+
run: |
57+
# This command finds all JavaScript files recursively and runs JSHint on them
58+
find ./server/database -name "*.js" -exec jshint {} +
59+
echo "Linted all the js files successfully"

0 commit comments

Comments
 (0)