Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 36 additions & 27 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,61 @@
name: Lint and Test
name: SearchlyAI

on:
push:
branches: [ "main" ]
branches: [ main ]
pull_request:
branches: [ "main" ]
branches: [ main ]

jobs:
build:
backend-lint-and-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8 black mypy isort pytest

- name: Run Black (Check)
run: black . --check

- name: Run Isort (Check)
run: isort . --check-only

- name: Run Flake8
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
pip install flake8

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

build-frontend:
frontend-lint-and-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: npm run lint
node-version: '18.x'
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Lint
run: npm run lint

Loading