@@ -34,23 +34,28 @@ jobs:
3434 needs : changes
3535 if : ${{ needs.changes.outputs.backend == 'true' }}
3636 runs-on : ubuntu-latest
37-
37+
3838 steps :
3939 - uses : actions/checkout@v4
40-
40+
4141 - name : Set up Python
4242 uses : actions/setup-python@v5
4343 with :
4444 python-version : ' 3.11'
4545 cache : ' pip'
46-
46+
4747 - name : Install dependencies
4848 working-directory : ./backend
4949 run : |
5050 python -m pip install --upgrade pip
51- pip install pytest pytest-cov httpx
51+ pip install pytest pytest-cov httpx flake8
5252 pip install -r requirements.txt
53-
53+
54+ - name : Lint (flake8)
55+ working-directory : ./backend
56+ run : |
57+ flake8 services/ routes/ middleware/ config/ dependencies.py main.py
58+
5459 - name : Run tests
5560 working-directory : ./backend
5661 env :
@@ -64,64 +69,63 @@ jobs:
6469 PINECONE_INDEX_NAME : " codeintel-test"
6570 run : |
6671 pytest tests/ -v --cov=services --cov-report=term-missing
67-
68- - name : Check code quality
69- working-directory : ./backend
70- run : |
71- pip install flake8
72- flake8 services/ --max-line-length=120 --ignore=E501,W503 || true
7372
7473 test-frontend :
7574 name : Frontend Tests
7675 needs : changes
7776 if : ${{ needs.changes.outputs.frontend == 'true' }}
7877 runs-on : ubuntu-latest
79-
78+
8079 steps :
8180 - uses : actions/checkout@v4
82-
81+
8382 - name : Set up Bun
8483 uses : oven-sh/setup-bun@v2
8584 with :
8685 bun-version : latest
87-
86+
8887 - name : Install dependencies
8988 working-directory : ./frontend
9089 run : bun install
91-
90+
91+ - name : Lint (ESLint)
92+ working-directory : ./frontend
93+ run : bun run lint
94+
95+ - name : Check TypeScript
96+ working-directory : ./frontend
97+ run : bun run tsc --noEmit
98+
9299 - name : Build frontend
93100 working-directory : ./frontend
94101 run : bun run build
95-
102+
96103 - name : Run tests
97104 working-directory : ./frontend
98105 run : bun run test
99-
100- - name : Check TypeScript
101- working-directory : ./frontend
102- run : bun run tsc --noEmit
103106
104107 security-scan :
105108 name : Security Scan
109+ needs : changes
110+ if : ${{ needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' }}
106111 runs-on : ubuntu-latest
107- continue-on-error : true
108-
112+
109113 steps :
110114 - uses : actions/checkout@v4
111115 with :
112116 fetch-depth : 0
113-
117+
114118 - name : Run Trivy vulnerability scanner
115119 uses : aquasecurity/trivy-action@master
116120 with :
117121 scan-type : ' fs'
118122 scan-ref : ' .'
119123 format : ' table'
120- exit-code : ' 0'
121-
124+ severity : ' CRITICAL,HIGH'
125+ exit-code : ' 1'
126+
122127 - name : Check for secrets
123128 uses : trufflesecurity/trufflehog@main
124- continue-on-error : true
125129 with :
126130 path : ./
127131 base : main
0 commit comments