-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 2.16 KB
/
Copy pathci.yml
File metadata and controls
89 lines (73 loc) · 2.16 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
name: Tests
on:
push:
branches: [main]
pull_request:
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
name: Backend (pytest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
backend/requirements.txt
backend/requirements-dev.txt
- name: Install dependencies
run: pip install -r backend/requirements.txt -r backend/requirements-dev.txt
- name: pip-audit
run: pip-audit -r backend/requirements.txt -r backend/requirements-dev.txt
- name: Bandit (security)
run: bandit -q -r backend/app -x backend/tests -ll
- name: Run pytest
working-directory: backend
run: python -m pytest -q --tb=short
frontend:
name: Frontend (vitest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: "24"
- name: Cache frontend npm
uses: actions/cache@v6
with:
path: frontend/node_modules
key: ${{ runner.os }}-node24-${{ hashFiles('frontend/package-lock.json', 'frontend/package.json') }}
restore-keys: |
${{ runner.os }}-node24-
- name: Install dependencies
working-directory: frontend
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
- name: npm audit
working-directory: frontend
run: npm audit --audit-level=moderate
continue-on-error: true
- name: Run Vitest
working-directory: frontend
run: npm test
security-scan:
name: Container (Trivy config)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Trivy filesystem scan (config + secrets)
uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: fs
scan-ref: .
severity: HIGH,CRITICAL
exit-code: "1"
ignore-unfixed: true