Skip to content

Commit ac6e89d

Browse files
authored
Create main.yml
1 parent 0c0947f commit ac6e89d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/main.yml

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

0 commit comments

Comments
 (0)