-
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (115 loc) · 3.38 KB
/
Copy pathci.yml
File metadata and controls
146 lines (115 loc) · 3.38 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
push:
branches: [main, develop, 'release/**']
pull_request:
branches: [main, develop]
env:
PYTHON_VERSION: '3.11'
NODE_VERSION: '20'
jobs:
lint:
name: Lint & Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install linting tools
run: pip install ruff black mypy
- name: Run Ruff
run: ruff check octalume tests --output-format=github
- name: Check formatting with Black
run: black --check octalume tests
- name: Run MyPy
run: mypy octalume --ignore-missing-imports
continue-on-error: true
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: pip install pip-audit bandit
- name: Run Bandit security scan
run: bandit -r octalume -ll
continue-on-error: true
- name: Check dependencies for vulnerabilities
run: pip-audit
continue-on-error: true
- name: Run Trivy scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
severity: 'CRITICAL,HIGH'
continue-on-error: true
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
needs: [lint]
strategy:
matrix:
python-version: ['3.11', '3.12']
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run tests with coverage
run: |
pytest tests/ -v --cov=octalume --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
if: matrix.python-version == '3.11'
with:
files: ./coverage.xml
fail_ci_if_error: false
build:
name: Build Package
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install build tools
run: pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist-packages
path: dist/
retention-days: 7
frontend:
name: Frontend Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: web/frontend/package-lock.json
- name: Install dependencies
working-directory: web/frontend
run: npm ci || npm install
- name: Build frontend
working-directory: web/frontend
run: npm run build
- name: Lint frontend
working-directory: web/frontend
run: npm run lint || true