forked from imDarshanGK/AI-dev-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (96 loc) · 2.65 KB
/
Copy pathci.yml
File metadata and controls
123 lines (96 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
name: Test Backend (Python ${{ matrix.python-version }})
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Ensure libmagic is installed
run: |
sudo apt-get update
sudo apt-get install -y libmagic1 libmagic-dev
- name: Install dependencies
run: |
cd backend
pip install -r requirements.txt
- name: Verify python-magic import
run: |
cd backend
python -c "import magic; print(magic.__file__)"
- name: Run backend tests
env:
RATE_LIMIT_PER_MINUTE: 300
run: |
cd backend
pytest -q --tb=short
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install Ruff
run: pip install ruff
- name: Run Ruff lint
run: ruff check backend/app --select E,F,W --ignore E501
frontend-check:
name: Frontend Check
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate frontend files exist
run: |
test -f frontend/index.html
echo "Frontend files verified"
secret-scan:
name: Secret Scan
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
format:
runs-on: ubuntu-latest
name: Format check
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install formatting tools
run: pip install black==24.10.0 isort==5.13.2
- name: Check formatting with black
run: |
git diff --name-only origin/main...HEAD -- '*.py' | \
xargs -r black --check
- name: Check import ordering with isort
run: |
git diff --name-only origin/main...HEAD -- '*.py' | \
xargs -r isort --check-only