-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (83 loc) · 2.42 KB
/
Copy pathcode-quality.yml
File metadata and controls
104 lines (83 loc) · 2.42 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
name: Code Quality
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python code quality tools
run: |
pip install black isort pylint mypy
- name: Check Python formatting with Black
run: |
black --check app/ tests/ || echo "Black formatting issues found"
continue-on-error: true
- name: Check import order with isort
run: |
isort --check-only app/ tests/ || echo "Import order issues found"
continue-on-error: true
- name: Run pylint
run: |
pip install -r requirements.txt
pylint app/ --exit-zero --output-format=text
continue-on-error: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install frontend dependencies
working-directory: ./frontend
run: npm ci
- name: Run ESLint
working-directory: ./frontend
run: |
npm run lint || echo "ESLint issues found"
continue-on-error: true
- name: Check code formatting with Prettier
working-directory: ./frontend
run: |
npx prettier --check "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}" || echo "Prettier formatting issues found"
continue-on-error: true
dependency-review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
fail-on-severity: moderate
codeql-analysis:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python', 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"